fix: quote in execaSudo

This commit is contained in:
Amin Yahyaabadi 2021-12-07 13:37:01 -06:00
parent 52b4862a75
commit 95c8ebb90c
4 changed files with 13 additions and 13 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

@ -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 {

View File

@ -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)
}