Skip to content

Commit

Permalink
Try calling external binaries as owner of brew.
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbound committed May 14, 2021
1 parent 9e901c2 commit eb2114b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Server/wwwroot/Content/Install-MacOS-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,28 @@ done


# Install Homebrew
su - $SUDO_USER -c '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
su - $SUDO_USER -c "brew update"

if [[ -n "$SUDO_USER" && "$SUDO_USER" != "root" ]]; then
su - $SUDO_USER -c '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
fi

Owner=$(ls -l /usr/local/bin/brew | awk '{print $3}')

su - $Owner -c "brew update"

# Install .NET Runtime
su - $SUDO_USER -c "brew install --cask dotnet"
su - $Owner -c "brew install --cask dotnet"

# Install dependency for System.Drawing.Common
su - $SUDO_USER -c "brew install mono-libgdiplus"
su - $Owner -c "brew install mono-libgdiplus"

# Install other dependencies
su - $SUDO_USER -c "brew install curl"
su - $SUDO_USER -c "brew install jq"
su - $Owner -c "brew install curl"
su - $Owner -c "brew install jq"


if [ -f "/usr/local/bin/Remotely/ConnectionInfo.json" ]; then
SavedGUID=`cat "/usr/local/bin/Remotely/ConnectionInfo.json" | jq -r '.DeviceID'`
SavedGUID=`su - $Owner -c "cat '/usr/local/bin/Remotely/ConnectionInfo.json' | jq -r '.DeviceID'"`
if [[ "$SavedGUID" != "null" && -n "$SavedGUID" ]]; then
GUID="$SavedGUID"
fi
Expand Down

0 comments on commit eb2114b

Please sign in to comment.