Skip to content

Commit

Permalink
fix(maker): handle name option for the deb, rpm makers as well as dmg
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound authored and malept committed Jun 5, 2017
1 parent 0ea55fa commit d335741
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/makers/linux/deb.js
Expand Up @@ -21,15 +21,17 @@ export default async ({ dir, targetArch, forgeConfig, packageJSON }) => {
const installer = require('electron-installer-debian');

const arch = debianArch(targetArch);
const outPath = path.resolve(dir, '../make', `${packageJSON.name}_${packageJSON.version}_${arch}.deb`);
const userConfig = configFn(forgeConfig.electronInstallerDebian, targetArch);
const versionedName = `${packageJSON.name}_${packageJSON.version}_${arch}`;
const outPath = path.resolve(dir, '../make', `${userConfig.name || versionedName}.deb`);

await ensureFile(outPath);
const debianDefaults = {
arch,
dest: path.dirname(outPath),
src: dir,
};
const debianConfig = Object.assign({}, configFn(forgeConfig.electronInstallerDebian, targetArch), debianDefaults);
const debianConfig = Object.assign({}, userConfig, debianDefaults);

await pify(installer)(debianConfig);
return [outPath];
Expand Down
6 changes: 4 additions & 2 deletions src/makers/linux/rpm.js
Expand Up @@ -21,15 +21,17 @@ export default async ({ dir, targetArch, forgeConfig, packageJSON }) => {
const installer = require('electron-installer-redhat');

const arch = rpmArch(targetArch);
const outPath = path.resolve(dir, '../make', `${packageJSON.name}-${packageJSON.version}.${arch}.rpm`);
const userConfig = configFn(forgeConfig.electronInstallerRedhat, targetArch);
const versionedName = `${packageJSON.name}-${packageJSON.version}.${arch}`;
const outPath = path.resolve(dir, '../make', `${userConfig.name || versionedName}.rpm`);

await ensureFile(outPath);
const rpmDefaults = {
arch,
dest: path.dirname(outPath),
src: dir,
};
const rpmConfig = Object.assign({}, configFn(forgeConfig.electronInstallerRedhat, targetArch), rpmDefaults);
const rpmConfig = Object.assign({}, userConfig, rpmDefaults);

await pify(installer)(rpmConfig);
return [outPath];
Expand Down

0 comments on commit d335741

Please sign in to comment.