From 41bcd6a57887721c84046fa594bded7e859cc0e4 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Sun, 7 Aug 2022 18:35:23 -0700 Subject: [PATCH] Revert "fix: do not assume that CI (e.g. Docker) is root" This reverts commit 0d99c85e653b826e1d29f4ca068876d900edd401. --- packages/sudo-tools/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/sudo-tools/src/index.ts b/packages/sudo-tools/src/index.ts index d564cc44..028d8654 100644 --- a/packages/sudo-tools/src/index.ts +++ b/packages/sudo-tools/src/index.ts @@ -3,7 +3,7 @@ import execa from "execa" /** Detect if sudo is available and the user has root privileges */ export function isSudo(): boolean { - return isRoot() && which.sync("sudo", { nothrow: true }) !== null + return (Boolean(process.env.CI) || isRoot()) && which.sync("sudo", { nothrow: true }) !== null } /** Detect if the process has root privileges */