update usage of yarn
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
import * as plugins from './npmci.plugins'
|
||||
import * as configModule from './npmci.config'
|
||||
import { bash, bashNoError } from './npmci.bash'
|
||||
import { nvmAvailable } from './npmci.bash'
|
||||
import {
|
||||
bash,
|
||||
bashNoError,
|
||||
nvmAvailable,
|
||||
yarnAvailable } from './npmci.bash'
|
||||
|
||||
/**
|
||||
* Install a specific version of node
|
||||
@@ -28,7 +31,7 @@ export let install = async (versionArg) => {
|
||||
await bash('node -v')
|
||||
await bash('npm -v')
|
||||
// lets look for further config
|
||||
configModule.getConfig()
|
||||
await configModule.getConfig()
|
||||
.then(async configArg => {
|
||||
plugins.beautylog.log('Now checking for needed global npm tools...')
|
||||
for (let npmTool of configArg.globalNpmTools) {
|
||||
@@ -39,7 +42,11 @@ export let install = async (versionArg) => {
|
||||
plugins.beautylog.log(`Tool ${npmTool} is available`)
|
||||
} else {
|
||||
plugins.beautylog.info(`globally installing ${npmTool} from npm`)
|
||||
await bash(`npm install ${npmTool} -q -g`)
|
||||
if (await yarnAvailable) {
|
||||
await bash(`yarn global add ${npmTool}`)
|
||||
} else {
|
||||
await bash(`npm install ${npmTool} -q -g`)
|
||||
}
|
||||
}
|
||||
}
|
||||
plugins.beautylog.success('all global npm tools specified in npmextra.json are now available!')
|
||||
|
||||
Reference in New Issue
Block a user