From 258a9dc96418a06d3cc5d98d43e58e167a67d036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=93=E8=8D=B7?= Date: Fri, 16 Nov 2018 19:16:28 +0800 Subject: [PATCH 1/2] overwrite keys of program when config file existed As the function option of commander sets true of 'reload' & 'launch'. --- src/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.js b/src/cli.js index 8db470f..d973b9e 100644 --- a/src/cli.js +++ b/src/cli.js @@ -91,7 +91,7 @@ if(program.config){ try{ var configOptions = require(program.config); - helper.extend( program, configOptions ); + helper.extend( program, configOptions, true ); }catch(e){ helper.log('Some Error occurs in ' + program.config + '\n' + e.message, 'error') From 16f5d5a0fa9f49e88f4d057cbcd97a318d8ff10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=93=E8=8D=B7?= Date: Sat, 17 Nov 2018 10:23:39 +0800 Subject: [PATCH 2/2] guarantee command in first priority --- src/cli.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli.js b/src/cli.js index d973b9e..a39ff11 100644 --- a/src/cli.js +++ b/src/cli.js @@ -92,6 +92,7 @@ if(program.config){ var configOptions = require(program.config); helper.extend( program, configOptions, true ); + program.parse(process.argv); }catch(e){ helper.log('Some Error occurs in ' + program.config + '\n' + e.message, 'error')