Skip to content

Commit

Permalink
sed conditional needs to go inside the ostype condition
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence committed Sep 22, 2023
1 parent 7f01bb9 commit a5afee4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions private/scripts/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,15 @@ function update_composer() {

if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OS
sed -i '' "s,%sagedir%,$sagedir," composer.new.json
if ! sed -i '' "s,%sagedir%,$sagedir," composer.new.json; then
echo "${red}Failed to add post-install hook to composer.json. Exiting here.${normal}"
exit 1;
else
# Linux
sed -i "s,%sagedir%,$sagedir," composer.new.json
fi
if ! sed -i '' "s,%sagedir%,$sagedir," composer.new.json; then
echo "${red}Failed to add post-install hook to composer.json. Exiting here.${normal}"
exit 1;
if ! sed -i "s,%sagedir%,$sagedir," composer.new.json; then
echo "${red}Failed to add post-install hook to composer.json. Exiting here.${normal}"
exit 1;
fi
fi

rm composer.json
Expand Down

0 comments on commit a5afee4

Please sign in to comment.