From 5d560f897b47233f9494ef258871b7f996cbd3e2 Mon Sep 17 00:00:00 2001 From: Vallie Joseph Date: Thu, 8 Dec 2022 20:28:54 +0000 Subject: [PATCH] updating execfile to use arg array --- packages/io/src/io.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/io/src/io.ts b/packages/io/src/io.ts index c385b5c3..ce318c25 100644 --- a/packages/io/src/io.ts +++ b/packages/io/src/io.ts @@ -126,15 +126,13 @@ export async function rmRF(inputPath: string): Promise { ) } try { - const cmdPath = ioUtil.getCmdPath() + // const cmdPath = ioUtil.getCmdPath() + const cmdArgs = ['/s', '/q', `${inputPath}`] if (await ioUtil.isDirectory(inputPath, true)) { - await execFile(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, { - env: {inputPath} - }) + await execFile('rd', cmdArgs) } else { - await execFile(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { - env: {inputPath} - }) + const cmdArgsDel = ['/f', '/a', `${inputPath}`] + await execFile('del', cmdArgsDel) } } catch (err) { // if you try to delete a file that doesn't exist, desired result is achieved