Fix heredoc tab error

This commit is contained in:
T. R. Bernstein
2024-06-27 11:19:04 +02:00
committed by T. R. Bernstein
parent 10b9b857b1
commit d8d641c671

View File

@@ -157,7 +157,8 @@ function downloadHomebrew() {
function createBrewCallerScript() { function createBrewCallerScript() {
local username=${homebrew_username} local username=${homebrew_username}
local brewCallerPath="${homebrew_prefix}/Homebrew/bin/brew_caller" local brewCallerPath="${homebrew_prefix}/Homebrew/bin/brew_caller"
print -- "#!/usr/bin/env zsh cat <<- BREWCALLER > ${brewCallerPath}
#!/usr/bin/env zsh
if [ \"\$(id -un)\" != \"${username}\" ]; then if [ \"\$(id -un)\" != \"${username}\" ]; then
echo 'brew will be run as ${username} user.' >&2 echo 'brew will be run as ${username} user.' >&2
sudo -E -u \"${username}\" \"\$0\" \"\$@\" sudo -E -u \"${username}\" \"\$0\" \"\$@\"
@@ -171,7 +172,8 @@ function createBrewCallerScript() {
export HOMEBREW_NO_ANALYTICS_THIS_RUN=1 export HOMEBREW_NO_ANALYTICS_THIS_RUN=1
export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1 export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1
umask 002 umask 002
\"${homebrew_prefix}/Homebrew/bin/brew\" \"\$@\"" > ${brewCallerPath} \"${homebrew_prefix}/Homebrew/bin/brew\" \"\$@\"
BREWCALLER
chown ${username}:admin ${brewCallerPath} chown ${username}:admin ${brewCallerPath}
chmod u+x,go-x ${brewCallerPath} chmod u+x,go-x ${brewCallerPath}
runAsHomebrewUser ln -sf ${homebrew_prefix}/Homebrew/bin/brew_caller "${homebrew_prefix}/bin/brew" runAsHomebrewUser ln -sf ${homebrew_prefix}/Homebrew/bin/brew_caller "${homebrew_prefix}/bin/brew"
@@ -196,7 +198,8 @@ function createLaunchDaemonsPlist() {
local launcherPath="/Library/LaunchDaemons/${launcherName}.plist" local launcherPath="/Library/LaunchDaemons/${launcherName}.plist"
[[ -f $launcherPath ]] && return [[ -f $launcherPath ]] && return
local brewCommand="$2" local brewCommand="$2"
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?> cat <<- LAUNCHDPLIST > ${launcherPath}
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\"> <!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
<plist version=\"1.0\"> <plist version=\"1.0\">
<dict> <dict>
@@ -217,7 +220,8 @@ function createLaunchDaemonsPlist() {
<key>Umask</key> <key>Umask</key>
<integer>2</integer> <integer>2</integer>
</dict> </dict>
</plist>" > "${launcherPath}" </plist>"
LAUNCHDPLIST
chown root:wheel ${launcherPath} chown root:wheel ${launcherPath}
chmod u=rw,go=r ${launcherPath} chmod u=rw,go=r ${launcherPath}
launchctl bootstrap system ${launcherPath} launchctl bootstrap system ${launcherPath}