diff --git a/dist/npmci.install.d.ts b/dist/npmci.install.d.ts index d656c66..33db07b 100644 --- a/dist/npmci.install.d.ts +++ b/dist/npmci.install.d.ts @@ -1,4 +1,4 @@ /// -import "typings-global"; -import * as plugins from "./npmci.plugins"; +import 'typings-global'; +import * as plugins from './npmci.plugins'; export declare let install: (versionArg: any) => plugins.q.Promise<{}>; diff --git a/dist/npmci.install.js b/dist/npmci.install.js index 67016e0..ed7db93 100644 --- a/dist/npmci.install.js +++ b/dist/npmci.install.js @@ -7,14 +7,14 @@ exports.install = (versionArg) => { let done = plugins.q.defer(); plugins.beautylog.log(`now installing node version ${versionArg}`); let version; - if (versionArg == "stable") { - version = "stable"; + if (versionArg === 'stable') { + version = 'stable'; } - else if (versionArg == "lts") { - version = "--lts"; + else if (versionArg === 'lts') { + version = '6'; } - else if (versionArg == "legacy") { - version = "6.6.0"; + else if (versionArg === 'legacy') { + version = '4'; } else { version = versionArg; @@ -25,12 +25,12 @@ exports.install = (versionArg) => { 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!'); } ; - npmci_bash_1.bash("node -v"); - npmci_bash_1.bash("npm -v"); + npmci_bash_1.bash('node -v'); + npmci_bash_1.bash('npm -v'); done.resolve(); return done.promise; }; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnBtY2kuaW5zdGFsbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL25wbWNpLmluc3RhbGwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLDBCQUF3QjtBQUN4QiwyQ0FBMkM7QUFDM0MsNkNBQW9DO0FBQ3BDLDZDQUEyQztBQUVoQyxRQUFBLE9BQU8sR0FBRyxDQUFDLFVBQVU7SUFDNUIsSUFBSSxJQUFJLEdBQUcsT0FBTyxDQUFDLENBQUMsQ0F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BQUEsQ0FBQztJQUNGLEVBQUUsQ0FBQyxDQUFDLHlCQUFZLENBQUMsQ0FBQyxDQUFDO1FBQ2YsaUJBQUksQ0FBQyxlQUFlLE9BQU8seUJBQXlCLE9BQU8sRUFBRSxDQUFDLENBQUE7UUFDOUQsT0FBTyxDQUFDLFNBQVMsQ0FBQyxPQUFPLENBQUMsZ0JBQWdCLE9BQU8sMEJBQTBCLENBQUMsQ0FBQTtJQUNoRixDQUFDO0lBQUMsSUFBSSxDQUFDLENBQUM7UUFDSixPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyx1REFBdUQsQ0FBQyxDQUFBO0lBQ25GLENBQUM7SUFBQSxDQUFDO0lBQ0YsaUJBQUksQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUNmLGlCQUFJLENBQUMsUUFBUSxDQUFDLENBQUE7SUFDZCxJQUFJLENBQUMsT0FBTyxFQUFFLENBQUE7SUFDZCxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQTtBQUN2QixDQUFDLENBQUEifQ== \ No newline at end of file diff --git a/ts/npmci.install.ts b/ts/npmci.install.ts index 8d98e85..fb8a822 100644 --- a/ts/npmci.install.ts +++ b/ts/npmci.install.ts @@ -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 } \ No newline at end of file