From 1db5d6e669d81a755264e595f7fac832e33306c4 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 8 Mar 2017 14:50:58 +0100 Subject: [PATCH] update async --- ts/npmci.bash.ts | 4 +--- ts/npmci.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ts/npmci.bash.ts b/ts/npmci.bash.ts index c329771..c9a77d8 100644 --- a/ts/npmci.bash.ts +++ b/ts/npmci.bash.ts @@ -19,8 +19,7 @@ checkNvm() * @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 */ -export let bash = (commandArg: string, retryArg: number = 2, bareArg: boolean = false): Promise => { - let done = plugins.q.defer() +export let bash = async (commandArg: string, retryArg: number = 2, bareArg: boolean = false): Promise => { let exitCode: number let stdOut: string let execResult @@ -57,7 +56,6 @@ export let bash = (commandArg: string, retryArg: number = 2, bareArg: boolean = } else { plugins.beautylog.log('ShellExec would be: ' + commandArg) } - return done.promise } /** diff --git a/ts/npmci.test.ts b/ts/npmci.test.ts index e0f0862..cddd102 100644 --- a/ts/npmci.test.ts +++ b/ts/npmci.test.ts @@ -14,12 +14,12 @@ export let test = async (versionArg): Promise => { } } -let npmDependencies = async () => { +let npmDependencies = async ():Promise => { plugins.beautylog.info('now installing dependencies:') await bash('npm install') } -let npmTest = async () => { +let npmTest = async (): Promise => { plugins.beautylog.info('now starting tests:') await bash('npm test') }