From 25dabd49551df04e5daf3e83bce531a8a60343ef Mon Sep 17 00:00:00 2001 From: Godzil Date: Wed, 1 Aug 2018 21:21:46 +0100 Subject: [PATCH] Fix #80, the batch file path should not be related to the output folder. Also make sure that an absolute path is not treated as a relative one! COOOKIESSSS!!!!!! --- src/batch.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/batch.ts b/src/batch.ts index 9a9b40f..11ed432 100644 --- a/src/batch.ts +++ b/src/batch.ts @@ -22,8 +22,16 @@ const resol_table: { [id: string]: IResolData; } = export default function(args: string[], done: (err?: Error) => void) { const config = Object.assign(cfg.load(), parse(args)); + let batchPath; - const batchPath = path.join(config.output || process.cwd(), config.batch); + if (path.isAbsolute(config.batch)) + { + batchPath = path.normalize(config.batch); + } + else + { + batchPath = path.normalize(path.join(process.cwd(), config.batch)); + } // Update the config file with new parameters cfg.save(config);