mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-22 20:19:06 +08:00
trying error throw
This commit is contained in:
parent
34a1b9f5c6
commit
3946ffb099
@ -7,6 +7,8 @@ import * as ioUtil from './io-util'
|
||||
// const exec = promisify(childProcess.exec)
|
||||
const execFile = promisify(childProcess.execFile)
|
||||
const spawn = childProcess.spawn
|
||||
const subprocess = spawn('bad_command')
|
||||
|
||||
/**
|
||||
* Interface for cp/mv options
|
||||
*/
|
||||
@ -130,10 +132,13 @@ export async function rmRF(inputPath: string): Promise<void> {
|
||||
const cmdPath = ioUtil.getCmdPath()
|
||||
if (await ioUtil.isDirectory(inputPath, true)) {
|
||||
spawn(cmdPath, [`/s /c "rd /s /q "%inputPath%""`], {
|
||||
shell: false,
|
||||
shell: true,
|
||||
env: {inputPath},
|
||||
timeout: 500
|
||||
})
|
||||
subprocess.on('error', err => {
|
||||
throw new Error(`Failed to delete ${inputPath}: ${err}`)
|
||||
})
|
||||
// await exec(`${cmdPath} /s /c "rd /s /q "%inputPath%""`, {
|
||||
// env: {inputPath}
|
||||
// })
|
||||
@ -143,6 +148,10 @@ export async function rmRF(inputPath: string): Promise<void> {
|
||||
env: {inputPath},
|
||||
timeout: 500
|
||||
})
|
||||
|
||||
subprocess.on('error', err => {
|
||||
throw new Error(`Failed to delete ${inputPath}: ${err}`)
|
||||
})
|
||||
// await exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
|
||||
// env: {inputPath}
|
||||
// })
|
||||
|
Loading…
x
Reference in New Issue
Block a user