update async

This commit is contained in:
Philipp Kunz 2017-03-08 14:50:58 +01:00
parent a54015da16
commit 1db5d6e669
2 changed files with 3 additions and 5 deletions

View File

@ -19,8 +19,7 @@ checkNvm()
* @param commandArg - The command to execute * @param commandArg - The command to execute
* @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined * @param retryArg - The retryArg: 0 to any positive number will retry, -1 will always succeed, -2 will return undefined
*/ */
export let bash = (commandArg: string, retryArg: number = 2, bareArg: boolean = false): Promise<string> => { export let bash = async (commandArg: string, retryArg: number = 2, bareArg: boolean = false): Promise<string> => {
let done = plugins.q.defer<string>()
let exitCode: number let exitCode: number
let stdOut: string let stdOut: string
let execResult let execResult
@ -57,7 +56,6 @@ export let bash = (commandArg: string, retryArg: number = 2, bareArg: boolean =
} else { } else {
plugins.beautylog.log('ShellExec would be: ' + commandArg) plugins.beautylog.log('ShellExec would be: ' + commandArg)
} }
return done.promise
} }
/** /**

View File

@ -14,12 +14,12 @@ export let test = async (versionArg): Promise<void> => {
} }
} }
let npmDependencies = async () => { let npmDependencies = async ():Promise <void> => {
plugins.beautylog.info('now installing dependencies:') plugins.beautylog.info('now installing dependencies:')
await bash('npm install') await bash('npm install')
} }
let npmTest = async () => { let npmTest = async (): Promise<void> => {
plugins.beautylog.info('now starting tests:') plugins.beautylog.info('now starting tests:')
await bash('npm test') await bash('npm test')
} }