Skip to content

Commit 4f87f66

Browse files
dilawarXenira
andauthored
Update crates/cli/src/lib.rs
Co-authored-by: Xenira <[email protected]>
1 parent 3e3b2a7 commit 4f87f66

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

crates/cli/src/lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,10 @@ impl Install {
200200
)?;
201201

202202
#[cfg(unix)]
203-
if !self.bypass_root_check {
204-
anyhow::ensure!(
205-
!is_root(),
206-
"Running as root is not recommended. Use --bypass-root-check to override."
207-
);
208-
}
203+
anyhow::ensure!(
204+
self.bypass_root_check || !is_root(),
205+
"Running as root is not recommended. Use --bypass-root-check to override."
206+
);
209207

210208
let (mut ext_dir, mut php_ini) = if let Some(install_dir) = self.install_dir {
211209
(install_dir, None)

0 commit comments

Comments
 (0)