From bf0e798aa89ed7215a01ae146d610081e2ece71e Mon Sep 17 00:00:00 2001 From: Tben Date: Sun, 20 Aug 2023 06:51:33 +0100 Subject: [PATCH] updates --- index.js | 6 +++++- package.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 5606d0d..3d2d6e0 100644 --- a/index.js +++ b/index.js @@ -86,9 +86,13 @@ process.on("exit", (code) => { const argvProcessListIndex = process.argv.indexOf("batch-run") + 1; const argvProcessList = process.argv.at(-1); - const processesFilePath = path.resolve(process.cwd(), "batchrun.config.json"); +if (argvProcessList?.match(/batchrun/i) && !fs.existsSync(processesFilePath)) { + console.error(` - ${colors.FgRed}Error:${colors.Reset} No arguments to run`); + process.exit(1); +} + if (fs.existsSync(processesFilePath)) { const processesFile = fs.readFileSync(processesFilePath, "utf8"); const processesArray = JSON.parse(processesFile); diff --git a/package.json b/package.json index 5534613..003b199 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "batchrun", - "version": "1.0.5", + "version": "1.0.6", "description": "Run and manage multiple processes concurrently in one terminal", "main": "index.js", "bin": {