mirror of https://github.com/aminya/setup-cpp
fix: quote in execaSudo
This commit is contained in:
parent
52b4862a75
commit
95c8ebb90c
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -35,28 +35,28 @@ export async function setupGcc(version: string, _setupDir: string, arch: string)
|
|||
case "linux": {
|
||||
if (arch === "x64") {
|
||||
await setupAptPack("gcc", version, [
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
"ppa:ubuntu-toolchain-r/test",
|
||||
])
|
||||
binDir = (
|
||||
await setupAptPack("g++", version, [
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
"ppa:ubuntu-toolchain-r/test",
|
||||
])
|
||||
).binDir
|
||||
} else {
|
||||
info(`Install g++-multilib because gcc for ${arch} was requested`)
|
||||
await setupAptPack("gcc-multilib", version, [
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
"ppa:ubuntu-toolchain-r/test",
|
||||
])
|
||||
binDir = (
|
||||
await setupAptPack("g++-multilib", version, [
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
|
||||
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
"ppa:ubuntu-toolchain-r/test",
|
||||
])
|
||||
).binDir
|
||||
|
@ -68,8 +68,8 @@ export async function setupGcc(version: string, _setupDir: string, arch: string)
|
|||
// case "none": {
|
||||
// if (arch === "arm" || arch === "arm64") {
|
||||
// return setupAptPack("gcc-arm-none-eabi", version, [
|
||||
// "'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
|
||||
// "'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
|
||||
// "deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
|
||||
// "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
|
||||
// "ppa:ubuntu-toolchain-r/test",
|
||||
// ])
|
||||
// } else {
|
||||
|
|
|
@ -21,7 +21,7 @@ export function mightSudo(command: string) {
|
|||
|
||||
export function execaSudo(file: string, args: string[], cwd?: string) {
|
||||
if (isRoot()) {
|
||||
return execa.command(`sudo ${[file, ...args].join(" ")}`, { shell: true, cwd })
|
||||
return execa.command(`sudo ${[file, ...args].map((arg) => `'${arg}'`).join(" ")}`, { shell: true, cwd })
|
||||
} else {
|
||||
return execa(file, args)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue