Skip to content

Commit

Permalink
feat(installer): don't suffix temp install files with .forge-install
Browse files Browse the repository at this point in the history
  • Loading branch information
malept committed Dec 31, 2016
1 parent e8c83cd commit a6f0749
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/electron-forge-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const main = async () => {

const tmpdir = path.resolve(os.tmpdir(), 'forge-install');
const pathSafeRepo = repo.replace(/\//g, '-').replace(/\\/g, '-');
const filename = `${pathSafeRepo}-${latestRelease.tag_name}-${targetAsset.name}.forge-install`;
const filename = `${pathSafeRepo}-${latestRelease.tag_name}-${targetAsset.name}`;

const fullFilePath = path.resolve(tmpdir, filename);
if (!await fs.exists(fullFilePath) || (await fs.stat(fullFilePath)).size !== targetAsset.size) {
Expand Down
11 changes: 1 addition & 10 deletions src/installers/darwin/dmg.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
import fs from 'fs-promise';
import opn from 'opn';
import path from 'path';
import pify from 'pify';
import { exec } from 'child_process';

export default async (filePath) => {
const DMGPath = path.join(path.dirname(filePath), path.parse(filePath).name);
if (await fs.exists(DMGPath)) {
await fs.remove(DMGPath);
}
await pify(exec)(`cp "${filePath}" "${DMGPath}"`);
await opn(DMGPath, { wait: false });
await opn(filePath, { wait: false });
};

0 comments on commit a6f0749

Please sign in to comment.