start unclutter env
This commit is contained in:
@@ -3,7 +3,7 @@ import * as plugins from "./npmci.plugins";
|
||||
export let bash = (commandArg:string,retryArg = 2) => {
|
||||
if(!process.env.NPMTS_TEST){
|
||||
for (let i = 0; i <= retryArg; i++){
|
||||
let exitCode = plugins.shelljs.exec(
|
||||
let exitCode:number = plugins.shelljs.exec(
|
||||
"bash -c \"source /usr/local/nvm/nvm.sh &&" +
|
||||
commandArg +
|
||||
"\""
|
||||
@@ -11,7 +11,10 @@ export let bash = (commandArg:string,retryArg = 2) => {
|
||||
if(exitCode !== 0 && i == retryArg){
|
||||
process.exit(1);
|
||||
} else if(exitCode == 0){
|
||||
i = retryArg + 1;
|
||||
i = retryArg + 1; // if everything works out ok retrials are not wanted
|
||||
} else {
|
||||
plugins.beautylog.warn("Something went wrong! Exit Code: " + exitCode.toString);
|
||||
plugins.beautylog.info("Retry " + (i + 1).toString + " of " + retryArg.toString);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -19,14 +22,17 @@ export let bash = (commandArg:string,retryArg = 2) => {
|
||||
}
|
||||
}
|
||||
|
||||
export let bashBare = (commandArg,retryArg = 3) => {
|
||||
export let bashBare = (commandArg,retryArg = 2) => {
|
||||
if (!process.env.NPMTS_TEST){
|
||||
for(let i = 0; i <= retryArg; i++){
|
||||
let exitCode = plugins.shelljs.exec(commandArg).code;
|
||||
let exitCode:number = plugins.shelljs.exec(commandArg).code;
|
||||
if(exitCode !== 0 && i == retryArg){
|
||||
process.exit(1);
|
||||
} else if(exitCode == 0){
|
||||
i = retryArg + 1;
|
||||
i = retryArg + 1; // if everything works out ok retrials are not wanted
|
||||
} else {
|
||||
plugins.beautylog.warn("Something went wrong! Exit Code: " + exitCode.toString);
|
||||
plugins.beautylog.info("Retry " + (i + 1).toString + " of " + retryArg.toString);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user