npmci/dist/npmci.bash.js
2016-06-05 16:43:27 +02:00

30 lines
3.2 KiB
JavaScript

"use strict";
require("typings-global");
var plugins = require("./npmci.plugins");
exports.bash = function (commandArg) {
if (!process.env.NPMTS_TEST) {
var 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);
}
};
exports.bashBare = function (commandArg) {
if (!process.env.NPMTS_TEST) {
var exitCode = plugins.shelljs.exec(commandArg).code;
if (exitCode !== 0) {
process.exit(1);
}
}
else {
plugins.beautylog.log("ShellExec would be: " + commandArg.blue);
}
};
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5wbWNpLmJhc2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixJQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQ2hDLFlBQUksR0FBRyxVQUFDLFVBQVU7SUFDekIsRUFBRSxDQUFBLENBQUMsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLFVBQVUsQ0FBQyxDQUFBLENBQUM7UUFDeEIsSUFBSSxRQUFRLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQy9CLDJDQUEyQztZQUMzQyxVQUFVO1lBQ1YsSUFBSSxDQUNQLENBQUMsSUFBSSxDQUFDO1FBQ1AsRUFBRSxDQUFBLENBQUMsUUFBUSxLQUFLLENBQUMsQ0FBQyxDQUFBLENBQUM7WUFDZixPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO1FBQ3BCLENBQUM7SUFDTCxDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDSixPQUFPLENBQUMsU0FBUyxDQUFDLEdBQUcs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