now correctly evaluating which output

This commit is contained in:
2016-12-15 01:08:54 +01:00
parent f156b58b95
commit e784c02a40
4 changed files with 6 additions and 8 deletions

View File

@ -67,6 +67,6 @@ export let bashBare = (commandArg: string, retryArg: number = 2) => {
/**
* bashNoError allows executing stuff without throwing an error
*/
export let bashNoError = (commandArg: string) => {
return bash(commandArg,-1)
export let bashNoError = (commandArg: string): string => {
return bash(commandArg, -1)
}

View File

@ -30,8 +30,7 @@ export let install = (versionArg) => {
for (let npmTool of configArg.globalNpmTools) {
plugins.beautylog.info(`Checking for global "${npmTool}"`)
let whichOutput = bashNoError(`which ${npmTool}`)
console.log(whichOutput)
let toolAvailable: boolean = !(/not\sfound/.test(whichOutput))
let toolAvailable: boolean = !((/not\sfound/.test(whichOutput)) || whichOutput === '')
if (toolAvailable) {
plugins.beautylog.log(`Tool ${npmTool} is available`)
} else {