Skip to content

Commit

Permalink
refactor(maker): compute outDir from providedOptions w/default
Browse files Browse the repository at this point in the history
  • Loading branch information
anulman authored and MarshallOfSound committed Mar 25, 2017
1 parent 1e26d25 commit d69e762
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api/make.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import packager from './package';
* @property {Array<string>} [overrideTargets] An array of make targets to override your forge config
* @property {string} [arch=host architecture] The target architecture
* @property {string} [platform=process.platform] The target platform. NOTE: This is limited to be the current platform at the moment
* @property {string} [outDir=`${dir}/out`] The path to the directory containing generated distributables
*/

/**
Expand All @@ -37,6 +38,8 @@ export default async (providedOptions = {}) => {
arch: electronHostArch(),
platform: process.platform,
}, providedOptions);

const outDir = providedOptions.outDir || `${dir}/out`;
asyncOra.interactive = interactive;

let forgeConfig;
Expand Down Expand Up @@ -96,7 +99,7 @@ export default async (providedOptions = {}) => {
const outputs = [];

for (const targetArch of targetArchs) {
const packageDir = path.resolve(dir, `out/${appName}-${declaredPlatform}-${targetArch}`);
const packageDir = path.resolve(outDir, `${appName}-${declaredPlatform}-${targetArch}`);
if (!(await fs.exists(packageDir))) {
throw new Error(`Couldn't find packaged app at: ${packageDir}`);
}
Expand Down

0 comments on commit d69e762

Please sign in to comment.