This commit is contained in:
Tben 2023-08-20 06:51:33 +01:00
parent 95cba870d4
commit bf0e798aa8
2 changed files with 6 additions and 2 deletions

View File

@ -86,9 +86,13 @@ process.on("exit", (code) => {
const argvProcessListIndex = process.argv.indexOf("batch-run") + 1; const argvProcessListIndex = process.argv.indexOf("batch-run") + 1;
const argvProcessList = process.argv.at(-1); const argvProcessList = process.argv.at(-1);
const processesFilePath = path.resolve(process.cwd(), "batchrun.config.json"); 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)) { if (fs.existsSync(processesFilePath)) {
const processesFile = fs.readFileSync(processesFilePath, "utf8"); const processesFile = fs.readFileSync(processesFilePath, "utf8");
const processesArray = JSON.parse(processesFile); const processesArray = JSON.parse(processesFile);

View File

@ -1,6 +1,6 @@
{ {
"name": "batchrun", "name": "batchrun",
"version": "1.0.5", "version": "1.0.6",
"description": "Run and manage multiple processes concurrently in one terminal", "description": "Run and manage multiple processes concurrently in one terminal",
"main": "index.js", "main": "index.js",
"bin": { "bin": {