Просмотр исходного кода

fix(options): remove external config support

evshiron лет назад: 8
Родитель
Сommit
248615c4fe
4 измененных файлов с 2 добавлено и 20 удалено
  1. 0 4
      src/bin/build.ts
  2. 0 4
      src/bin/run.ts
  3. 1 6
      src/lib/Builder.ts
  4. 1 6
      src/lib/Runner.ts

+ 0 - 4
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;
 

+ 0 - 4
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;
 

+ 1 - 6
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) {

+ 1 - 6
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({