From 0bae517554d3c0230ae7408226051f3fbc899573 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sun, 29 Oct 2023 13:27:53 +0100 Subject: [PATCH] Bugfix --- deploy/start.js | 30 +++++++++++++++++------------- package.json | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/deploy/start.js b/deploy/start.js index 4a217de..af8eca5 100755 --- a/deploy/start.js +++ b/deploy/start.js @@ -71,12 +71,6 @@ function startProcess({ command, preflight, redeploy_file, port, first_run }) { console.log("******************************"); try { - const runPreflight = preflightFn(preflight); - - if (!runPreflight) { - // TODO: Action to take if preflight fails - } - if (!preflight) { console.log( `${colors.FgRed}Error:${colors.Reset} No preflight included in config file. If you don't want to run any preflight command simply add an empty array.` @@ -84,13 +78,23 @@ function startProcess({ command, preflight, redeploy_file, port, first_run }) { process.exit(); } - killChild(port).then((kill) => { - if (kill) { - childProcess = run(command); - } else { - process.exit(); - } - }); + const runPreflight = preflightFn(preflight); + + if (!runPreflight) { + // TODO: Action to take if preflight fails + + console.log( + `${colors.FgRed}Error:${colors.Reset} No preflight included in config file. If you don't want to run any preflight command simply add an empty array.` + ); + } else { + killChild(port).then((kill) => { + if (kill) { + childProcess = run(command); + } else { + process.exit(); + } + }); + } } catch (/** @type {*} */ error) { console.log( `${colors.FgRed}Error:${colors.Reset} killing child processes => ${error.message}` diff --git a/package.json b/package.json index cc62ef3..5a0d300 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nodecid", - "version": "1.0.3", + "version": "1.0.4", "description": "Simple CI/CD process", "main": "index.js", "bin": {