Skip to content

Commit 842a824

Browse files
committed
fix(HasSudoPassword): Refine sudo password application condition
- Enhance the condition for applying the sudo password to exclude specific PHP SAPI environments. - This change prevents unnecessary sudo password application in CLI and embedded contexts. Signed-off-by: guanguans <[email protected]>
1 parent 2fd77fa commit 842a824

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Concerns/HasSudoPassword.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ public function withSudoPassword(
4343

4444
protected function shouldApplySudoPassword(): bool
4545
{
46-
return $this->sudoPassword && OsHelper::isUnix();
46+
return $this->sudoPassword && OsHelper::isUnix() && !\in_array(
47+
\PHP_SAPI,
48+
[
49+
'cli',
50+
// 'cli-server',
51+
'embed',
52+
'phpdbg',
53+
],
54+
true
55+
);
4756
}
4857
}

0 commit comments

Comments
 (0)