fix: fix execaSudo

This commit is contained in:
Amin Yahyaabadi 2021-09-18 08:48:00 -05:00
parent 51da3adc7b
commit c9b478842d
4 changed files with 4 additions and 4 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

@ -20,7 +20,7 @@ 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("sudo", [file, ...args]) return execa.command(`sudo ${[file, ...args].join(" ")}`, { shell: true })
} else { } else {
return execa(file, args) return execa(file, args)
} }

View File

@ -10,7 +10,7 @@ export async function setupAptPack(
version?: string, version?: string,
repository: boolean | string = true repository: boolean | string = true
): Promise<InstallationInfo> { ): Promise<InstallationInfo> {
const apt = "apt-get" // mightSudo const apt = "apt-get"
if (typeof repository === "string") { if (typeof repository === "string") {
await execaSudo("add-apt-repository", ["--update", "-y", repository]) await execaSudo("add-apt-repository", ["--update", "-y", repository])