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:
Godzil 2018-08-01 00:43:07 +01:00
parent b947a110e2
commit 6f192b1712

View File

@ -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();
}