mirror of https://github.com/actions/toolkit
adding windows verbatim args
parent
4b6dd2fbd0
commit
17bd5c18e9
|
@ -4,7 +4,8 @@ import * as path from 'path'
|
||||||
import {promisify} from 'util'
|
import {promisify} from 'util'
|
||||||
import * as ioUtil from './io-util'
|
import * as ioUtil from './io-util'
|
||||||
|
|
||||||
const exec = promisify(childProcess.exec)
|
// const exec = promisify(childProcess.exec)
|
||||||
|
// const fork = promisify(childProcess.fork)
|
||||||
const execFile = promisify(childProcess.execFile)
|
const execFile = promisify(childProcess.execFile)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -129,12 +130,14 @@ export async function rmRF(inputPath: string): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const cmdPath = ioUtil.getCmdPath()
|
const cmdPath = ioUtil.getCmdPath()
|
||||||
if (await ioUtil.isDirectory(inputPath, true)) {
|
if (await ioUtil.isDirectory(inputPath, true)) {
|
||||||
await exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
await execFile(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||||||
env: {inputPath}
|
env: {inputPath},
|
||||||
|
windowsVerbatimArguments: true
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
await exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
await execFile(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
||||||
env: {inputPath}
|
env: {inputPath},
|
||||||
|
windowsVerbatimArguments: true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue