npmci/ts/npmci.bash.ts

27 lines
755 B
TypeScript
Raw Normal View History

2016-05-30 01:40:07 +00:00
import "typings-global";
import * as plugins from "./npmci.plugins";
export let bash = (commandArg) => {
2016-06-05 12:55:08 +00:00
if(!process.env.NPMTS_TEST){
let exitCode = plugins.shelljs.exec(
"bash -c \"source /usr/local/nvm/nvm.sh &&" +
commandArg +
"\""
).code;
if(exitCode !== 0){
process.exit(1);
}
} else {
plugins.beautylog.log("ShellExec would be: " + commandArg.blue)
2016-05-30 01:43:15 +00:00
}
}
2016-06-05 12:55:08 +00:00
export let bashBare = (commandArg) => {
if (!process.env.NPMTS_TEST){
let exitCode = plugins.shelljs.exec(commandArg).code;
if(exitCode !== 0){
process.exit(1);
}
} else {
plugins.beautylog.log("ShellExec would be: " + commandArg.blue)
}
2016-05-30 01:40:07 +00:00
}