Skip to content

Commit 95c8ebb

Browse files
committed
fix: quote in execaSudo
1 parent 52b4862 commit 95c8ebb

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
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.

src/gcc/gcc.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ export async function setupGcc(version: string, _setupDir: string, arch: string)
3535
case "linux": {
3636
if (arch === "x64") {
3737
await setupAptPack("gcc", version, [
38-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
39-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
38+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
39+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
4040
"ppa:ubuntu-toolchain-r/test",
4141
])
4242
binDir = (
4343
await setupAptPack("g++", version, [
44-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
45-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
44+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
45+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
4646
"ppa:ubuntu-toolchain-r/test",
4747
])
4848
).binDir
4949
} else {
5050
info(`Install g++-multilib because gcc for ${arch} was requested`)
5151
await setupAptPack("gcc-multilib", version, [
52-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
53-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
52+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
53+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
5454
"ppa:ubuntu-toolchain-r/test",
5555
])
5656
binDir = (
5757
await setupAptPack("g++-multilib", version, [
58-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
59-
"'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
58+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
59+
"deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
6060
"ppa:ubuntu-toolchain-r/test",
6161
])
6262
).binDir
@@ -68,8 +68,8 @@ export async function setupGcc(version: string, _setupDir: string, arch: string)
6868
// case "none": {
6969
// if (arch === "arm" || arch === "arm64") {
7070
// return setupAptPack("gcc-arm-none-eabi", version, [
71-
// "'deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai'",
72-
// "'deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe'",
71+
// "deb http://dk.archive.ubuntu.com/ubuntu/ xenial mai",
72+
// "deb http://dk.archive.ubuntu.com/ubuntu/ xenial universe",
7373
// "ppa:ubuntu-toolchain-r/test",
7474
// ])
7575
// } else {

src/utils/env/sudo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export function mightSudo(command: string) {
2121

2222
export function execaSudo(file: string, args: string[], cwd?: string) {
2323
if (isRoot()) {
24-
return execa.command(`sudo ${[file, ...args].join(" ")}`, { shell: true, cwd })
24+
return execa.command(`sudo ${[file, ...args].map((arg) => `'${arg}'`).join(" ")}`, { shell: true, cwd })
2525
} else {
2626
return execa(file, args)
2727
}

0 commit comments

Comments
 (0)