npmci/dist/npmci.install.js

36 lines
2.6 KiB
JavaScript
Raw Permalink Normal View History

2016-05-30 00:29:30 +00:00
"use strict";
require("typings-global");
2016-07-18 14:56:53 +00:00
const plugins = require("./npmci.plugins");
const npmci_bash_1 = require("./npmci.bash");
2016-08-02 21:11:42 +00:00
const npmci_bash_2 = require("./npmci.bash");
2016-07-18 14:56:53 +00:00
exports.install = (versionArg) => {
let done = plugins.q.defer();
plugins.beautylog.log(`now installing node version ${versionArg}`);
2016-07-18 14:56:53 +00:00
let version;
2016-06-29 21:18:51 +00:00
if (versionArg == "stable") {
2016-07-18 14:56:53 +00:00
version = "6.3.0";
2016-06-29 21:18:51 +00:00
}
else if (versionArg == "lts") {
2016-07-18 15:17:57 +00:00
version = "6.3.0";
2016-05-30 00:29:30 +00:00
}
2016-06-01 04:04:20 +00:00
else if (versionArg == "legacy") {
2016-07-18 15:17:57 +00:00
version = "6.3.0";
2016-06-01 03:44:48 +00:00
}
2016-05-30 00:29:30 +00:00
else {
version = versionArg;
}
;
2016-08-02 21:11:42 +00:00
if (npmci_bash_2.nvmAvailable) {
npmci_bash_1.bash(`nvm install ${version} && nvm alias default ${version}`);
plugins.beautylog.success(`Node version ${version} successfully installed!`);
}
else {
plugins.beautylog.warn("Nvm not in path so staying at installed node version!");
}
;
2016-05-30 01:54:14 +00:00
npmci_bash_1.bash("node -v");
npmci_bash_1.bash("npm -v");
2016-05-30 00:29:30 +00:00
done.resolve();
return done.promise;
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuaW5zdGFsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLmluc3RhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLFFBQU8sZ0JBQWdCLENBQUMsQ0FBQTtBQUN4QixNQUFZLE9BQU8sV0FBTSxpQkFBaUIsQ0FBQyxDQUFBO0FBQzNDLDZCQUFx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