Skip to content

Commit a5ae6fa

Browse files
committed
Remove option --config. Close #13
1 parent 18840c0 commit a5ae6fa

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bin/velocity

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ commander
1717
.description(pkg.description)
1818
.option('-v, --version', 'output version number')
1919
.option('-d, --debug', 'show debug message')
20-
.option('-C, --config <s>', 'config file')
2120
.option('-O, --root <s>', 'template root path', utilx.split)
2221
.option('-M, --macro <s>', 'global macro file/input', utilx.split)
2322
.option('-t, --template <s>', 'template file/input')
@@ -40,10 +39,8 @@ commander.parse(process.argv)
4039
var cfg = utilx.cGetCfg(commander)
4140

4241
// Merge config file
43-
var cfgFile = cfg.config || './velocity-config.js'
42+
var cfgFile = './velocity-config.js'
4443
if (utilx.isExistedFile(cfgFile)) {
45-
;delete cfg.config
46-
4744
var projCfg = require(path.resolve(cfgFile))
4845
cfg = utilx.mix(cfg, projCfg)
4946
}

lib/handle-cfg.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ var defCfg = {
99
}
1010

1111
module.exports = function(cfg) {
12-
//logger.debug('Raw config', cfg)
12+
// logger.debug('Raw config', cfg)
13+
14+
var cfgFile = './velocity-config.js'
15+
if (utilx.isExistedFile(cfgFile)) {
16+
var projCfg = require(path.resolve(cfgFile))
17+
cfg = utilx.mix(cfg, projCfg)
18+
// logger.debug('Mix project config', cfg)
19+
}
1320

1421
cfg = utilx.mix(cfg, defCfg)
1522

0 commit comments

Comments
 (0)