Fix heredoc tab error
This commit is contained in:
committed by
T. R. Bernstein
parent
10b9b857b1
commit
d8d641c671
@@ -157,7 +157,8 @@ function downloadHomebrew() {
|
||||
function createBrewCallerScript() {
|
||||
local username=${homebrew_username}
|
||||
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
|
||||
echo 'brew will be run as ${username} user.' >&2
|
||||
sudo -E -u \"${username}\" \"\$0\" \"\$@\"
|
||||
@@ -171,7 +172,8 @@ function createBrewCallerScript() {
|
||||
export HOMEBREW_NO_ANALYTICS_THIS_RUN=1
|
||||
export HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT=1
|
||||
umask 002
|
||||
\"${homebrew_prefix}/Homebrew/bin/brew\" \"\$@\"" > ${brewCallerPath}
|
||||
\"${homebrew_prefix}/Homebrew/bin/brew\" \"\$@\"
|
||||
BREWCALLER
|
||||
chown ${username}:admin ${brewCallerPath}
|
||||
chmod u+x,go-x ${brewCallerPath}
|
||||
runAsHomebrewUser ln -sf ${homebrew_prefix}/Homebrew/bin/brew_caller "${homebrew_prefix}/bin/brew"
|
||||
@@ -196,9 +198,10 @@ function createLaunchDaemonsPlist() {
|
||||
local launcherPath="/Library/LaunchDaemons/${launcherName}.plist"
|
||||
[[ -f $launcherPath ]] && return
|
||||
local brewCommand="$2"
|
||||
echo "<?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\">
|
||||
<plist version=\"1.0\">
|
||||
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\">
|
||||
<plist version=\"1.0\">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>${launcherName}</string>
|
||||
@@ -217,7 +220,8 @@ function createLaunchDaemonsPlist() {
|
||||
<key>Umask</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
</plist>" > "${launcherPath}"
|
||||
</plist>"
|
||||
LAUNCHDPLIST
|
||||
chown root:wheel ${launcherPath}
|
||||
chmod u=rw,go=r ${launcherPath}
|
||||
launchctl bootstrap system ${launcherPath}
|
||||
|
||||
Reference in New Issue
Block a user