Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(options): remove external config support
Browse files Browse the repository at this point in the history
  • Loading branch information
evshiron committed Mar 30, 2017
1 parent c542451 commit 248615c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
4 changes: 0 additions & 4 deletions src/bin/build.ts
Expand Up @@ -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;

Expand Down
4 changes: 0 additions & 4 deletions src/bin/run.ts
Expand Up @@ -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;

Expand Down
7 changes: 1 addition & 6 deletions src/lib/Builder.ts
Expand Up @@ -22,7 +22,6 @@ interface IBuilderOptions {
x86?: boolean;
x64?: boolean;
mirror?: string;
config?: string;
mute?: boolean;
}

Expand All @@ -35,7 +34,6 @@ export class Builder {
x86: false,
x64: false,
mirror: Downloader.DEFAULT_OPTIONS.mirror,
config: undefined,
mute: true,
};

Expand Down Expand Up @@ -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) {
Expand Down
7 changes: 1 addition & 6 deletions src/lib/Runner.ts
Expand Up @@ -17,7 +17,6 @@ interface IRunnerOptions {
x64?: boolean;
mirror?: string;
detached?: boolean;
config?: string;
mute?: boolean;
}

Expand All @@ -28,7 +27,6 @@ export class Runner {
x64: false,
mirror: Downloader.DEFAULT_OPTIONS.mirror,
detached: false,
config: undefined,
mute: true,
};

Expand All @@ -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({
Expand Down

0 comments on commit 248615c

Please sign in to comment.