update node versions
This commit is contained in:
@ -1,29 +1,29 @@
|
||||
import "typings-global";
|
||||
import * as plugins from "./npmci.plugins";
|
||||
import { bash } from "./npmci.bash";
|
||||
import { nvmAvailable } from "./npmci.bash"
|
||||
import 'typings-global';
|
||||
import * as plugins from './npmci.plugins';
|
||||
import { bash } from './npmci.bash';
|
||||
import { nvmAvailable } from './npmci.bash'
|
||||
|
||||
export let install = (versionArg) => {
|
||||
let done = plugins.q.defer();
|
||||
plugins.beautylog.log(`now installing node version ${versionArg}`);
|
||||
let version: string;
|
||||
if (versionArg == "stable") {
|
||||
version = "stable";
|
||||
} else if (versionArg == "lts") {
|
||||
version = "--lts";
|
||||
} else if (versionArg == "legacy") {
|
||||
version = "6.6.0"
|
||||
let done = plugins.q.defer()
|
||||
plugins.beautylog.log(`now installing node version ${versionArg}`)
|
||||
let version: string
|
||||
if (versionArg === 'stable') {
|
||||
version = 'stable'
|
||||
} else if (versionArg === 'lts') {
|
||||
version = '6'
|
||||
} else if (versionArg === 'legacy') {
|
||||
version = '4'
|
||||
} else {
|
||||
version = versionArg;
|
||||
version = versionArg
|
||||
};
|
||||
if (nvmAvailable) {
|
||||
bash(`nvm install ${version} && nvm alias default ${version}`)
|
||||
plugins.beautylog.success(`Node version ${version} successfully installed!`);
|
||||
plugins.beautylog.success(`Node version ${version} successfully installed!`)
|
||||
} else {
|
||||
plugins.beautylog.warn("Nvm not in path so staying at installed node version!");
|
||||
plugins.beautylog.warn('Nvm not in path so staying at installed node version!')
|
||||
};
|
||||
bash("node -v");
|
||||
bash("npm -v");
|
||||
done.resolve();
|
||||
return done.promise;
|
||||
bash('node -v')
|
||||
bash('npm -v')
|
||||
done.resolve()
|
||||
return done.promise
|
||||
}
|
Reference in New Issue
Block a user