Browse Source

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!!!!!!

Godzil 5 years ago
parent
commit
25dabd4955
1 changed files with 9 additions and 1 deletions
  1. 9 1
      src/batch.ts

+ 9 - 1
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);