Skip to content

Commit

Permalink
Fix syntax error using BSD flavored sed for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
wezm committed Mar 25, 2018
1 parent 7821b0b commit 827b71d
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/install_host_app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,18 @@ else
curl -sSL "$MANIFEST_URL" > "$MANIFEST_FILE_PATH"
fi

# Replace path to host
sed -i -e "s/PLACEHOLDER/$ESCAPED_HOST_FILE_PATH/" "$MANIFEST_FILE_PATH"

# Replace path to python3 executable
sed -i "1c#\!${PYTHON3_PATH}" "$HOST_FILE_PATH"
if [ $(uname -s) == 'Darwin' ]; then
# Replace path to python3 executable
/usr/bin/sed -i '' "1 s@.*@#\!${PYTHON3_PATH}@" "$HOST_FILE_PATH"
# Replace path to host
/usr/bin/sed -i '' -e "s/PLACEHOLDER/$ESCAPED_HOST_FILE_PATH/" "$MANIFEST_FILE_PATH"
else
# Replace path to python3 executable
sed -i "1c#\!${PYTHON3_PATH}" "$HOST_FILE_PATH"
# Replace path to host
sed -i -e "s/PLACEHOLDER/$ESCAPED_HOST_FILE_PATH/" "$MANIFEST_FILE_PATH"
fi

# Set permissions for the manifest so that all users can read it.
chmod a+x "$HOST_FILE_PATH"
Expand Down

0 comments on commit 827b71d

Please sign in to comment.