mirror of https://github.com/aminya/setup-cpp
fix: fix execaSudo
This commit is contained in:
parent
51da3adc7b
commit
c9b478842d
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -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])
|
||||||
|
|
Loading…
Reference in New Issue