From 6f192b1712717c7f54cd9f4b443fcfaf0d86bcb6 Mon Sep 17 00:00:00 2001 From: Godzil Date: Wed, 1 Aug 2018 00:43:07 +0100 Subject: [PATCH] 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 --- src/batch.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/batch.ts b/src/batch.ts index aff9943..447a933 100644 --- a/src/batch.ts +++ b/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(); }