Skip to content

Commit 12fe81a

Browse files
committed
fix: update execa
1 parent 4cedc87 commit 12fe81a

File tree

13 files changed

+96
-32
lines changed

13 files changed

+96
-32
lines changed

dist/setup_cpp.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup_cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@actions/exec": "^1.1.0",
3434
"@actions/io": "^1.1.1",
3535
"@actions/tool-cache": "^1.7.1",
36-
"execa": "^5.1.1",
36+
"execa": "^6.0.0",
3737
"hasha": "^5.2.2",
3838
"mri": "^1.2.0",
3939
"semver": "^7.3.5",

pnpm-lock.yaml

Lines changed: 69 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/chocolatey/chocolatey.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable require-atomic-updates */
2-
import execa from "execa"
2+
import * as execa from "execa"
33
import { existsSync } from "fs"
44
import { dirname } from "path"
55
import which from "which"
@@ -30,7 +30,7 @@ export function setupChocolatey(
3030
}
3131

3232
// https://docs.chocolatey.org/en-us/choco/setup#install-with-cmd.exe
33-
execa.commandSync(
33+
execa.execaCommandSync(
3434
`@"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\\chocolatey\\bin"`
3535
)
3636

src/doxygen/doxygen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export async function setupDoxygen(version: string | undefined, _setupDir: strin
1919
* See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
2020
* The process cannot access the file 'C:\ProgramData\chocolatey\lib\Graphviz\.chocolateyPending' because it is being used by another process.
2121
*
22-
* 18 | execa.sync("choco", ["install", "-y", name, `--version=${version}`, ...args])
22+
* 18 | execa.execaSync("choco", ["install", "-y", name, `--version=${version}`, ...args])
2323
* 19 | } else {
24-
* > 20 | execa.sync("choco", ["install", "-y", name, ...args])
24+
* > 20 | execa.execaSync("choco", ["install", "-y", name, ...args])
2525
* | ^
2626
* 21 | }
2727
* 22 |

src/utils/env/sudo.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import execa from "execa"
1+
import * as execa from "execa"
22
import which from "which"
33

44
let _issudo: boolean | undefined = undefined
@@ -21,8 +21,8 @@ export function mightSudo(command: string) {
2121

2222
export function execaSudo(file: string, args: string[]) {
2323
if (isRoot()) {
24-
return execa.command(`sudo ${[file, ...args].join(" ")}`, { shell: true })
24+
return execa.execaCommand(`sudo ${[file, ...args].join(" ")}`, { shell: true })
2525
} else {
26-
return execa(file, args)
26+
return execa.execa(file, args)
2727
}
2828
}

src/utils/path/addPath.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { addPath as ghAddPath } from "@actions/core"
22
import { delimiter } from "path"
33
import * as core from "@actions/core"
4-
import execa from "execa"
4+
import * as execa from "execa"
55

66
/** An add path function that works locally or inside GitHub Actions */
77
export function addPath(path: string) {
@@ -12,13 +12,13 @@ export function addPath(path: string) {
1212
core.error(err as Error)
1313
switch (process.platform) {
1414
case "win32": {
15-
execa.sync(`setx PATH=${path};%PATH%`)
15+
execa.execaSync(`setx PATH=${path};%PATH%`)
1616
return
1717
}
1818
case "linux":
1919
case "darwin": {
20-
execa.commandSync(`echo "export PATH=${path}:$PATH" >> ~/.profile`)
21-
execa.commandSync(`source ~/.profile`)
20+
execa.execaCommandSync(`echo "export PATH=${path}:$PATH" >> ~/.profile`)
21+
execa.execaCommandSync(`source ~/.profile`)
2222
core.info(`${path} was added to ~/.profile`)
2323
return
2424
}

src/utils/setup/extract.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import execa from "execa"
1+
import * as execa from "execa"
22
import { mkdirP } from "@actions/io"
33
export { extractTar, extractXar, extract7z, extractZip } from "@actions/tool-cache"
44

55
export async function extractExe(file: string, dest: string) {
6-
await execa("7z", ["x", file, `-o${dest}`])
6+
await execa.execa("7z", ["x", file, `-o${dest}`])
77
return dest
88
}
99

@@ -13,6 +13,6 @@ export async function extractTarByExe(file: string, dest: string, flags = ["--st
1313
} catch {
1414
// ignore
1515
}
16-
await execa("tar", ["xf", file, "-C", dest, ...flags])
16+
await execa.execa("tar", ["xf", file, "-C", dest, ...flags])
1717
return dest
1818
}

src/utils/setup/setupBrewPack.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint-disable require-atomic-updates */
2-
import execa from "execa"
2+
import * as execa from "execa"
33
import which from "which"
44
import { setupBrew } from "../../brew/brew"
55
import { InstallationInfo } from "./setupBin"
@@ -14,7 +14,7 @@ export function setupBrewPack(name: string, version?: string): InstallationInfo
1414
}
1515

1616
// brew is not thread-safe
17-
execa.sync("brew", ["install", version !== undefined && version !== "" ? `${name}@${version}` : name])
17+
execa.execaSync("brew", ["install", version !== undefined && version !== "" ? `${name}@${version}` : name])
1818

1919
return { binDir: "/usr/local/bin/" }
2020
}

0 commit comments

Comments
 (0)