diff --git a/src/bin/build.ts b/src/bin/build.ts index c122313..f5bbca9 100644 --- a/src/bin/build.ts +++ b/src/bin/build.ts @@ -39,10 +39,6 @@ const argv = require('yargs') describe: 'Modify NW.js mirror', default: Builder.DEFAULT_OPTIONS.mirror, }) -.option('config', { - describe: 'Specify external config', - default: Builder.DEFAULT_OPTIONS.config, -}) .help() .argv; diff --git a/src/bin/run.ts b/src/bin/run.ts index 2670ff4..db6e296 100644 --- a/src/bin/run.ts +++ b/src/bin/run.ts @@ -26,10 +26,6 @@ const argv = require('yargs') type: 'boolean', default: Runner.DEFAULT_OPTIONS.detached, }) -.option('config', { - describe: 'Specify external config', - default: Runner.DEFAULT_OPTIONS.config, -}) .help() .argv; diff --git a/src/lib/Builder.ts b/src/lib/Builder.ts index e07daee..0dcbba3 100644 --- a/src/lib/Builder.ts +++ b/src/lib/Builder.ts @@ -22,7 +22,6 @@ interface IBuilderOptions { x86?: boolean; x64?: boolean; mirror?: string; - config?: string; mute?: boolean; } @@ -35,7 +34,6 @@ export class Builder { x86: false, x64: false, mirror: Downloader.DEFAULT_OPTIONS.mirror, - config: undefined, mute: true, }; @@ -72,12 +70,9 @@ export class Builder { throw new Error('ERROR_NO_TASK'); } - const configPath = this.options.config ? this.options.config : join(this.dir, 'package.json'); - - const pkg: any = await readJsonAsync(configPath); + const pkg: any = await readJsonAsync(join(this.dir, 'package.json')); const config = new BuildConfig(pkg); - debug('in build', 'configPath', configPath); debug('in build', 'config', config); for(const [ platform, arch ] of tasks) { diff --git a/src/lib/Runner.ts b/src/lib/Runner.ts index 383ddea..eb23fa4 100644 --- a/src/lib/Runner.ts +++ b/src/lib/Runner.ts @@ -17,7 +17,6 @@ interface IRunnerOptions { x64?: boolean; mirror?: string; detached?: boolean; - config?: string; mute?: boolean; } @@ -28,7 +27,6 @@ export class Runner { x64: false, mirror: Downloader.DEFAULT_OPTIONS.mirror, detached: false, - config: undefined, mute: true, }; @@ -50,12 +48,9 @@ export class Runner { ? (this.options.x86 ? 'ia32' : 'x64') : process.arch; - const configPath = this.options.config ? this.options.config : join(this.args[0], 'package.json'); - - const pkg: any = await readJsonAsync(configPath); + const pkg: any = await readJsonAsync(join(this.args[0], 'package.json')); const config = new BuildConfig(pkg); - debug('in run', 'configPath', configPath); debug('in run', 'config', config); const downloader = new Downloader({