Bugfix
This commit is contained in:
parent
8816b0292b
commit
e75d08ca10
@ -73,6 +73,10 @@ function startProcess({ command, preflight, redeploy_file, port, first_run }) {
|
|||||||
try {
|
try {
|
||||||
const runPreflight = preflightFn(preflight);
|
const runPreflight = preflightFn(preflight);
|
||||||
|
|
||||||
|
if (!runPreflight) {
|
||||||
|
// TODO: Action to take if preflight fails
|
||||||
|
}
|
||||||
|
|
||||||
if (!preflight) {
|
if (!preflight) {
|
||||||
console.log(
|
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.`
|
`${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.`
|
||||||
@ -164,16 +168,18 @@ function preflightFn(preflight) {
|
|||||||
if (typeof preflight == "string") {
|
if (typeof preflight == "string") {
|
||||||
execFileSync(preflight, options);
|
execFileSync(preflight, options);
|
||||||
} else if (typeof preflight == "object" && preflight?.[0]) {
|
} else if (typeof preflight == "object" && preflight?.[0]) {
|
||||||
preflight.forEach((cmd, index) => {
|
for (let i = 0; i < preflight.length; i++) {
|
||||||
|
const cmd = preflight[i];
|
||||||
try {
|
try {
|
||||||
const execCmd = execSync(cmd, options);
|
const execCmd = execSync(cmd, options);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(
|
console.log(
|
||||||
`${colors.FgRed}Error:${colors.Reset} Preflight command ${cmd} Failed! => ${error.message}`
|
`${colors.FgRed}Error:${colors.Reset} Preflight command ${cmd} Failed! => ${error.message}`
|
||||||
);
|
);
|
||||||
process.exit();
|
return false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "nodecid",
|
"name": "nodecid",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"description": "Simple CI/CD process",
|
"description": "Simple CI/CD process",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
Reference in New Issue
Block a user