From cea51c67087e283b723b3419caa900700f962515 Mon Sep 17 00:00:00 2001 From: Daniel Imhoff Date: Sun, 3 Mar 2019 14:19:40 -0600 Subject: [PATCH] refactor(subprocess): use `isExecutableFile` from fs utils --- packages/@ionic/utils-subprocess/src/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/@ionic/utils-subprocess/src/index.ts b/packages/@ionic/utils-subprocess/src/index.ts index 503b503a89..1306e03f59 100644 --- a/packages/@ionic/utils-subprocess/src/index.ts +++ b/packages/@ionic/utils-subprocess/src/index.ts @@ -1,5 +1,5 @@ import { reduce } from '@ionic/utils-array'; -import { pathExecutable, statSafe } from '@ionic/utils-fs'; +import { isExecutableFile } from '@ionic/utils-fs'; import { createProcessEnv } from '@ionic/utils-process'; import { WritableStreamBuffer } from '@ionic/utils-stream'; import { ChildProcess, ForkOptions, SpawnOptions, fork as _fork } from 'child_process'; @@ -214,9 +214,8 @@ export async function which(command: string, { PATH = process.env.PATH || '' }: } const p = pathlib.join(v, command); - const [ stats, executable ] = await Promise.all([statSafe(p), pathExecutable(p)]); - if (stats && (stats.isFile() || stats.isSymbolicLink()) && executable) { + if (await isExecutableFile(p)) { return p; }