Skip to content

Commit f8e41b6

Browse files
authored
fix: detect macOS ACL support using uname instead of chmod output (#4137)
Running `chmod` without arguments to detect macOS ACL support outputs an error: "chmod: missing operand" which clutters deployment logs. Since `chmod +a` is macOS-specific (Linux and FreeBSD use setfacl), directly checking `uname -s === 'Darwin'` is cleaner and more reliable than parsing chmod's error output.
1 parent 27b0898 commit f8e41b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

recipe/deploy/writable.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@
9999
$remoteUser = run('whoami');
100100
}
101101
$httpUser = get('http_user');
102-
if (strpos(run("chmod 2>&1; true"), '+a') !== false) {
103-
// Try OS-X specific setting of access-rights
102+
if (run("uname -s") === 'Darwin') {
103+
// macOS supports chmod +a for ACL management
104104

105105
run("$sudo chmod +a \"$httpUser allow delete,write,append,file_inherit,directory_inherit\" $dirs");
106106
run("$sudo chmod +a \"$remoteUser allow delete,write,append,file_inherit,directory_inherit\" $dirs");

0 commit comments

Comments
 (0)