Compare commits

..

5 Commits

Author SHA1 Message Date
Vallie Joseph a99da03c77 . 2022-12-12 05:26:28 +00:00
Vallie Joseph e0023baa89 trying execFileSync 2022-12-12 05:12:53 +00:00
Vallie Joseph 17bd5c18e9 adding windows verbatim args 2022-12-12 05:05:46 +00:00
Vallie Joseph 4b6dd2fbd0 Test 2022-12-08 20:44:39 +00:00
Vallie Joseph d6c6f72a70 Test 2022-12-08 20:38:15 +00:00
11 changed files with 23 additions and 14 deletions
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set Node.js 12.x - name: Set Node.js 12.x
uses: actions/setup-node@v3 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 12.x
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set Node.js 12.x - name: Set Node.js 12.x
uses: actions/setup-node@v3 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 12.x
+1 -1
View File
@@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set Node.js 12.x - name: Set Node.js 12.x
uses: actions/setup-node@v3 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 12.x
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
run: ls packages/${{ github.event.inputs.package }} run: ls packages/${{ github.event.inputs.package }}
- name: Set Node.js 12.x - name: Set Node.js 12.x
uses: actions/setup-node@v3 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 12.x
+1 -1
View File
@@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Set Node.js 12.x - name: Set Node.js 12.x
uses: actions/setup-node@v3 uses: actions/setup-node@v1
with: with:
node-version: 12.x node-version: 12.x
+1 -1
View File
@@ -221,7 +221,7 @@ console.log(`We can even get context data, like the repo: ${context.repo.repo}`)
## Contributing ## Contributing
We welcome contributions. See [how to contribute](.github/CONTRIBUTING.md). We welcome contributions. See [how to contribute](.github/CONTRIBUTING.md).
hi
## Code of Conduct ## Code of Conduct
See [our code of conduct](CODE_OF_CONDUCT.md). See [our code of conduct](CODE_OF_CONDUCT.md).
+1 -1
View File
@@ -32,7 +32,7 @@ jobs:
os: [ubuntu-16.04, windows-2019] os: [ubuntu-16.04, windows-2019]
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
actions: actions:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v1
with: with:
version: ${{matrix.node}} version: ${{matrix.node}}
- run: | - run: |
+1 -1
View File
@@ -18,7 +18,7 @@ e.g. To use https://github.com/actions/setup-node, users will author:
```yaml ```yaml
steps: steps:
using: actions/setup-node@v3 using: actions/setup-node@v1
``` ```
# Define Metadata # Define Metadata
+2 -2
View File
@@ -1,12 +1,12 @@
{ {
"name": "@actions/io", "name": "@actions/io",
"version": "1.1.2", "version": "1.1.3",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@actions/io", "name": "@actions/io",
"version": "1.1.2", "version": "1.1.3",
"license": "MIT" "license": "MIT"
} }
} }
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@actions/io", "name": "@actions/io",
"version": "1.1.2", "version": "1.1.3",
"description": "Actions io lib", "description": "Actions io lib",
"keywords": [ "keywords": [
"github", "github",
+12 -3
View File
@@ -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,20 @@ 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}
}).catch(err => {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT') throw err
}) })
} else { } else {
await exec(`${cmdPath} /s /c "del /f /a "%inputPath%""`, { await execFile(`${cmdPath} /s /c "del /f /a "%inputPath%""`, {
env: {inputPath} env: {inputPath}
}).catch(err => {
// if you try to delete a file that doesn't exist, desired result is achieved
// other errors are valid
if (err.code !== 'ENOENT') throw err
}) })
} }
} catch (err) { } catch (err) {