Now use the config file for base configuration, and command line parameter to
overide some of these parameter. The config file is updated from the command line parameters
This commit is contained in:
parent
b947a110e2
commit
6f192b1712
10
src/batch.ts
10
src/batch.ts
@ -3,6 +3,7 @@ import commander = require('commander');
|
||||
import fs = require('fs');
|
||||
import path = require('path');
|
||||
import log = require('./log');
|
||||
import cfg = require('./config');
|
||||
import series from './series';
|
||||
|
||||
/* correspondances between resolution and value CR excpect */
|
||||
@ -19,9 +20,13 @@ const resol_table: { [id: string]: IResolData; } =
|
||||
*/
|
||||
export default function(args: string[], done: (err?: Error) => void)
|
||||
{
|
||||
const config = parse(args);
|
||||
const config = Object.assign(cfg.load(), parse(args));
|
||||
|
||||
const batchPath = path.join(config.output || process.cwd(), config.batch);
|
||||
|
||||
// Update the config file with new parameters
|
||||
cfg.save(config);
|
||||
|
||||
// set resolution
|
||||
if (config.resolution)
|
||||
{
|
||||
@ -73,6 +78,9 @@ export default function(args: string[], done: (err?: Error) => void)
|
||||
{
|
||||
if (i >= tasksArr.length)
|
||||
{
|
||||
// Save configuration before leaving (should store info like session & other)
|
||||
cfg.save(config);
|
||||
|
||||
return done();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user