fix: update execa

This commit is contained in:
Amin Yahyaabadi 2021-12-01 04:21:51 -06:00
parent 4cedc87c6c
commit 12fe81ac31
13 changed files with 96 additions and 32 deletions

2
dist/setup_cpp.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -33,7 +33,7 @@
"@actions/exec": "^1.1.0", "@actions/exec": "^1.1.0",
"@actions/io": "^1.1.1", "@actions/io": "^1.1.1",
"@actions/tool-cache": "^1.7.1", "@actions/tool-cache": "^1.7.1",
"execa": "^5.1.1", "execa": "^6.0.0",
"hasha": "^5.2.2", "hasha": "^5.2.2",
"mri": "^1.2.0", "mri": "^1.2.0",
"semver": "^7.3.5", "semver": "^7.3.5",

View File

@ -21,7 +21,7 @@ importers:
cross-env: 7.0.3 cross-env: 7.0.3
cross-spawn: ^7.0.3 cross-spawn: ^7.0.3
eslint-config-atomic: ^1.16.5 eslint-config-atomic: ^1.16.5
execa: ^5.1.1 execa: ^6.0.0
hasha: ^5.2.2 hasha: ^5.2.2
jest: ^27.4.2 jest: ^27.4.2
mri: ^1.2.0 mri: ^1.2.0
@ -40,7 +40,7 @@ importers:
'@actions/exec': 1.1.0 '@actions/exec': 1.1.0
'@actions/io': 1.1.1 '@actions/io': 1.1.1
'@actions/tool-cache': 1.7.1 '@actions/tool-cache': 1.7.1
execa: 5.1.1 execa: 6.0.0
hasha: 5.2.2 hasha: 5.2.2
mri: 1.2.0 mri: 1.2.0
semver: 7.3.5 semver: 7.3.5
@ -3914,8 +3914,24 @@ packages:
merge-stream: 2.0.0 merge-stream: 2.0.0
npm-run-path: 4.0.1 npm-run-path: 4.0.1
onetime: 5.1.2 onetime: 5.1.2
signal-exit: 3.0.3 signal-exit: 3.0.6
strip-final-newline: 2.0.0 strip-final-newline: 2.0.0
dev: true
/execa/6.0.0:
resolution: {integrity: sha512-m4wU9j4Z9nXXoqT8RSfl28JSwmMNLFF69OON8H/lL3NeU0tNpGz313bcOfYoBBHokB0dC2tMl3VUcKgHELhL2Q==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
cross-spawn: 7.0.3
get-stream: 6.0.1
human-signals: 3.0.1
is-stream: 3.0.0
merge-stream: 2.0.0
npm-run-path: 5.0.1
onetime: 6.0.0
signal-exit: 3.0.6
strip-final-newline: 3.0.0
dev: false
/exit-on-epipe/1.0.1: /exit-on-epipe/1.0.1:
resolution: {integrity: sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==} resolution: {integrity: sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==}
@ -4504,6 +4520,12 @@ packages:
/human-signals/2.1.0: /human-signals/2.1.0:
resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==}
engines: {node: '>=10.17.0'} engines: {node: '>=10.17.0'}
dev: true
/human-signals/3.0.1:
resolution: {integrity: sha512-rQLskxnM/5OCldHo+wNXbpVgDn5A17CUoKX+7Sokwaknlq7CdSnphy0W39GU8dw59XiCXmFXDg4fRuckQRKewQ==}
engines: {node: '>=12.20.0'}
dev: false
/iconv-lite/0.4.24: /iconv-lite/0.4.24:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
@ -4791,6 +4813,11 @@ packages:
resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==}
engines: {node: '>=8'} engines: {node: '>=8'}
/is-stream/3.0.0:
resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dev: false
/is-string/1.0.7: /is-string/1.0.7:
resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==}
engines: {node: '>= 0.4'} engines: {node: '>= 0.4'}
@ -5901,6 +5928,12 @@ packages:
/mimic-fn/2.1.0: /mimic-fn/2.1.0:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
engines: {node: '>=6'} engines: {node: '>=6'}
dev: true
/mimic-fn/4.0.0:
resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==}
engines: {node: '>=12'}
dev: false
/minimalistic-assert/1.0.1: /minimalistic-assert/1.0.1:
resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==}
@ -6055,6 +6088,14 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
dependencies: dependencies:
path-key: 3.1.1 path-key: 3.1.1
dev: true
/npm-run-path/5.0.1:
resolution: {integrity: sha512-ybBJQUSyFwEEhqO2lXmyKOl9ucHtyZBWVM0h0FiMfT/+WKxCUZFa95qAR2X3w/w6oigN3B0b2UNHZbD+kdfD5w==}
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
dependencies:
path-key: 4.0.0
dev: false
/nth-check/2.0.0: /nth-check/2.0.0:
resolution: {integrity: sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==} resolution: {integrity: sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==}
@ -6159,6 +6200,14 @@ packages:
engines: {node: '>=6'} engines: {node: '>=6'}
dependencies: dependencies:
mimic-fn: 2.1.0 mimic-fn: 2.1.0
dev: true
/onetime/6.0.0:
resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==}
engines: {node: '>=12'}
dependencies:
mimic-fn: 4.0.0
dev: false
/open/7.4.2: /open/7.4.2:
resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==} resolution: {integrity: sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==}
@ -6366,6 +6415,11 @@ packages:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'} engines: {node: '>=8'}
/path-key/4.0.0:
resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==}
engines: {node: '>=12'}
dev: false
/path-parse/1.0.7: /path-parse/1.0.7:
resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==}
dev: true dev: true
@ -7267,7 +7321,7 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
dependencies: dependencies:
onetime: 5.1.2 onetime: 5.1.2
signal-exit: 3.0.3 signal-exit: 3.0.6
dev: true dev: true
/reusify/1.0.4: /reusify/1.0.4:
@ -7414,6 +7468,10 @@ packages:
/signal-exit/3.0.3: /signal-exit/3.0.3:
resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==} resolution: {integrity: sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==}
dev: true
/signal-exit/3.0.6:
resolution: {integrity: sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==}
/sisteransi/1.0.5: /sisteransi/1.0.5:
resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==}
@ -7657,6 +7715,12 @@ packages:
/strip-final-newline/2.0.0: /strip-final-newline/2.0.0:
resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==}
engines: {node: '>=6'} engines: {node: '>=6'}
dev: true
/strip-final-newline/3.0.0:
resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==}
engines: {node: '>=12'}
dev: false
/strip-json-comments/1.0.4: /strip-json-comments/1.0.4:
resolution: {integrity: sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=} resolution: {integrity: sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=}
@ -8301,7 +8365,7 @@ packages:
dependencies: dependencies:
imurmurhash: 0.1.4 imurmurhash: 0.1.4
is-typedarray: 1.0.0 is-typedarray: 1.0.0
signal-exit: 3.0.3 signal-exit: 3.0.6
typedarray-to-buffer: 3.1.5 typedarray-to-buffer: 3.1.5
dev: true dev: true

View File

@ -1,5 +1,5 @@
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
import execa from "execa" import * as execa from "execa"
import { existsSync } from "fs" import { existsSync } from "fs"
import { dirname } from "path" import { dirname } from "path"
import which from "which" import which from "which"
@ -30,7 +30,7 @@ export function setupChocolatey(
} }
// https://docs.chocolatey.org/en-us/choco/setup#install-with-cmd.exe // https://docs.chocolatey.org/en-us/choco/setup#install-with-cmd.exe
execa.commandSync( execa.execaCommandSync(
`@"%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"` `@"%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"`
) )

View File

@ -19,9 +19,9 @@ export async function setupDoxygen(version: string | undefined, _setupDir: strin
* See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). * See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
* The process cannot access the file 'C:\ProgramData\chocolatey\lib\Graphviz\.chocolateyPending' because it is being used by another process. * The process cannot access the file 'C:\ProgramData\chocolatey\lib\Graphviz\.chocolateyPending' because it is being used by another process.
* *
* 18 | execa.sync("choco", ["install", "-y", name, `--version=${version}`, ...args]) * 18 | execa.execaSync("choco", ["install", "-y", name, `--version=${version}`, ...args])
* 19 | } else { * 19 | } else {
* > 20 | execa.sync("choco", ["install", "-y", name, ...args]) * > 20 | execa.execaSync("choco", ["install", "-y", name, ...args])
* | ^ * | ^
* 21 | } * 21 | }
* 22 | * 22 |

View File

@ -1,4 +1,4 @@
import execa from "execa" import * as execa from "execa"
import which from "which" import which from "which"
let _issudo: boolean | undefined = undefined let _issudo: boolean | undefined = undefined
@ -21,8 +21,8 @@ export function mightSudo(command: string) {
export function execaSudo(file: string, args: string[]) { export function execaSudo(file: string, args: string[]) {
if (isRoot()) { if (isRoot()) {
return execa.command(`sudo ${[file, ...args].join(" ")}`, { shell: true }) return execa.execaCommand(`sudo ${[file, ...args].join(" ")}`, { shell: true })
} else { } else {
return execa(file, args) return execa.execa(file, args)
} }
} }

View File

@ -1,7 +1,7 @@
import { addPath as ghAddPath } from "@actions/core" import { addPath as ghAddPath } from "@actions/core"
import { delimiter } from "path" import { delimiter } from "path"
import * as core from "@actions/core" import * as core from "@actions/core"
import execa from "execa" import * as execa from "execa"
/** An add path function that works locally or inside GitHub Actions */ /** An add path function that works locally or inside GitHub Actions */
export function addPath(path: string) { export function addPath(path: string) {
@ -12,13 +12,13 @@ export function addPath(path: string) {
core.error(err as Error) core.error(err as Error)
switch (process.platform) { switch (process.platform) {
case "win32": { case "win32": {
execa.sync(`setx PATH=${path};%PATH%`) execa.execaSync(`setx PATH=${path};%PATH%`)
return return
} }
case "linux": case "linux":
case "darwin": { case "darwin": {
execa.commandSync(`echo "export PATH=${path}:$PATH" >> ~/.profile`) execa.execaCommandSync(`echo "export PATH=${path}:$PATH" >> ~/.profile`)
execa.commandSync(`source ~/.profile`) execa.execaCommandSync(`source ~/.profile`)
core.info(`${path} was added to ~/.profile`) core.info(`${path} was added to ~/.profile`)
return return
} }

View File

@ -1,9 +1,9 @@
import execa from "execa" import * as execa from "execa"
import { mkdirP } from "@actions/io" import { mkdirP } from "@actions/io"
export { extractTar, extractXar, extract7z, extractZip } from "@actions/tool-cache" export { extractTar, extractXar, extract7z, extractZip } from "@actions/tool-cache"
export async function extractExe(file: string, dest: string) { export async function extractExe(file: string, dest: string) {
await execa("7z", ["x", file, `-o${dest}`]) await execa.execa("7z", ["x", file, `-o${dest}`])
return dest return dest
} }
@ -13,6 +13,6 @@ export async function extractTarByExe(file: string, dest: string, flags = ["--st
} catch { } catch {
// ignore // ignore
} }
await execa("tar", ["xf", file, "-C", dest, ...flags]) await execa.execa("tar", ["xf", file, "-C", dest, ...flags])
return dest return dest
} }

View File

@ -1,5 +1,5 @@
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
import execa from "execa" import * as execa from "execa"
import which from "which" import which from "which"
import { setupBrew } from "../../brew/brew" import { setupBrew } from "../../brew/brew"
import { InstallationInfo } from "./setupBin" import { InstallationInfo } from "./setupBin"
@ -14,7 +14,7 @@ export function setupBrewPack(name: string, version?: string): InstallationInfo
} }
// brew is not thread-safe // brew is not thread-safe
execa.sync("brew", ["install", version !== undefined && version !== "" ? `${name}@${version}` : name]) execa.execaSync("brew", ["install", version !== undefined && version !== "" ? `${name}@${version}` : name])
return { binDir: "/usr/local/bin/" } return { binDir: "/usr/local/bin/" }
} }

View File

@ -3,7 +3,7 @@ import { addPath } from "../path/addPath"
import which from "which" import which from "which"
import { setupChocolatey } from "../../chocolatey/chocolatey" import { setupChocolatey } from "../../chocolatey/chocolatey"
import { InstallationInfo } from "./setupBin" import { InstallationInfo } from "./setupBin"
import execa from "execa" import * as execa from "execa"
let hasChoco = false let hasChoco = false
@ -15,9 +15,9 @@ export async function setupChocoPack(name: string, version?: string, args: strin
} }
if (version !== undefined && version !== "") { if (version !== undefined && version !== "") {
execa.sync("choco", ["install", "-y", name, `--version=${version}`, ...args]) execa.execaSync("choco", ["install", "-y", name, `--version=${version}`, ...args])
} else { } else {
execa.sync("choco", ["install", "-y", name, ...args]) execa.execaSync("choco", ["install", "-y", name, ...args])
} }
const binDir = "C:/ProgramData/Chocolatey/bin/" const binDir = "C:/ProgramData/Chocolatey/bin/"

View File

@ -1,6 +1,6 @@
/* eslint-disable require-atomic-updates */ /* eslint-disable require-atomic-updates */
import { getExecOutput } from "@actions/exec" import { getExecOutput } from "@actions/exec"
import execa from "execa" import * as execa from "execa"
import which from "which" import which from "which"
import { info } from "@actions/core" import { info } from "@actions/core"
import { addPath } from "../path/addPath" import { addPath } from "../path/addPath"
@ -26,7 +26,7 @@ export async function setupPipPack(name: string, version?: string) {
} }
} }
execa.sync(pip, ["install", version !== undefined && version !== "" ? `${name}==${version}` : name]) execa.execaSync(pip, ["install", version !== undefined && version !== "" ? `${name}==${version}` : name])
if (binDir === undefined) { if (binDir === undefined) {
if (process.platform === "linux") { if (process.platform === "linux") {

View File

@ -1,5 +1,5 @@
import { addPath, warning } from "@actions/core" import { addPath, warning } from "@actions/core"
import execa from "execa" import * as execa from "execa"
import { existsSync } from "fs" import { existsSync } from "fs"
import { dirname, join } from "path" import { dirname, join } from "path"
import which from "which" import which from "which"
@ -12,11 +12,11 @@ let hasVCPKG = false
export function setupVcpkg(_version: string, setupDir: string, _arch: string): InstallationInfo { export function setupVcpkg(_version: string, setupDir: string, _arch: string): InstallationInfo {
if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) { if (!hasVCPKG || which.sync("vcpkg", { nothrow: true }) === null) {
if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) { if (!existsSync(join(setupDir, addShellExtension("bootstrap-vcpkg")))) {
execa.sync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) }) execa.execaSync("git", ["clone", "https://github.com/microsoft/vcpkg"], { cwd: dirname(setupDir) })
} else { } else {
warning(`Vcpkg folder already exists at ${setupDir}`) warning(`Vcpkg folder already exists at ${setupDir}`)
} }
execa.sync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: setupDir, shell: true }) execa.execaSync(addShellExtension(addShellHere("bootstrap-vcpkg")), { cwd: setupDir, shell: true })
addPath(setupDir) addPath(setupDir)
hasVCPKG = true hasVCPKG = true
return { binDir: setupDir } return { binDir: setupDir }