mirror of https://github.com/actions/toolkit
updating execfile to use arg array
parent
e566d60a34
commit
5d560f897b
|
@ -126,15 +126,13 @@ export async function rmRF(inputPath: string): Promise<void> {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const cmdPath = ioUtil.getCmdPath()
|
// const cmdPath = ioUtil.getCmdPath()
|
||||||
|
const cmdArgs = ['/s', '/q', `${inputPath}`]
|
||||||
if (await ioUtil.isDirectory(inputPath, true)) {
|
if (await ioUtil.isDirectory(inputPath, true)) {
|
||||||
await execFile(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
await execFile('rd', cmdArgs)
|
||||||
env: {inputPath}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
await execFile(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
const cmdArgsDel = ['/f', '/a', `${inputPath}`]
|
||||||
env: {inputPath}
|
await execFile('del', cmdArgsDel)
|
||||||
})
|
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// if you try to delete a file that doesn't exist, desired result is achieved
|
// if you try to delete a file that doesn't exist, desired result is achieved
|
||||||
|
|
Loading…
Reference in New Issue