fix: do not assume that CI (e.g. Docker) is root

This commit is contained in:
Amin Yahyaabadi 2022-08-07 17:31:51 -07:00
parent 2cdfbab204
commit 0d99c85e65
5 changed files with 5 additions and 5 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

2
dist/setup_cpp.mjs 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

@ -3,7 +3,7 @@ import execa from "execa"
/** Detect if sudo is available and the user has root privileges */ /** Detect if sudo is available and the user has root privileges */
export function isSudo(): boolean { export function isSudo(): boolean {
return (Boolean(process.env.CI) || isRoot()) && which.sync("sudo", { nothrow: true }) !== null return isRoot() && which.sync("sudo", { nothrow: true }) !== null
} }
/** Detect if the process has root privileges */ /** Detect if the process has root privileges */