Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4229b9c5c2 | |||
| 499bfd9710 | |||
| 3946ffb099 | |||
| 34a1b9f5c6 | |||
| 2e5fdbcbfd | |||
| c6cc3ac742 |
Generated
+1
-1
@@ -29852,4 +29852,4 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -29,4 +29,4 @@
|
|||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^3.9.9"
|
"typescript": "^3.9.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
# @actions/io Releases
|
# @actions/io Releases
|
||||||
|
|
||||||
### 1.1.3
|
|
||||||
- [Fixed a security bug where we used child_proccess.exec instead of execFile for windows](https://github.com/actions/toolkit/pull/1255)
|
|
||||||
### 1.1.2
|
### 1.1.2
|
||||||
- Update `lockfileVersion` to `v2` in `package-lock.json [#1020](https://github.com/actions/toolkit/pull/1020)
|
- Update `lockfileVersion` to `v2` in `package-lock.json [#1020](https://github.com/actions/toolkit/pull/1020)
|
||||||
|
|
||||||
|
|||||||
Generated
+3
-3
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"version": "1.1.3",
|
"version": "1.1.2",
|
||||||
"description": "Actions io lib",
|
"description": "Actions io lib",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"github",
|
"github",
|
||||||
@@ -34,4 +34,4 @@
|
|||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-5
@@ -4,7 +4,10 @@ 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 execFile = promisify(childProcess.execFile)
|
const execFile = promisify(childProcess.execFile)
|
||||||
|
const spawn = childProcess.spawn
|
||||||
|
const subprocess = spawn('bad_command')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for cp/mv options
|
* Interface for cp/mv options
|
||||||
@@ -126,13 +129,34 @@ 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('rd', cmdArgs)
|
// deletes a dir then sets output to quiet
|
||||||
|
spawn(cmdPath, ['/s', '/c', 'rd "%inputPath%"'], {
|
||||||
|
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}
|
||||||
|
// })
|
||||||
} else {
|
} else {
|
||||||
const cmdArgsDel = ['/f', '/a', `${inputPath}`]
|
// deletes a file then pipes output
|
||||||
await execFile('del', cmdArgsDel)
|
spawn(cmdPath, ['/s', '/c', `del "%inputPath%"`], {
|
||||||
|
shell: false,
|
||||||
|
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}
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
} 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
|
||||||
|
|||||||
Reference in New Issue
Block a user