Skip to content

Commit

Permalink
Make scripts work on WSL and Mac
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed May 3, 2024
1 parent 478ed5d commit db81406
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion bin/down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#!/bin/bash
basedir=$(dirname "$0")/..
mutagen-compose -f "$basedir"/docker-compose.yml down
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
IP_ADDR=$(ifconfig -l | xargs -n1 ipconfig getifaddr)
elif [[ "$OSTYPE" == "darwin"* ]]; then
IP_ADDR=$(ip route get 1 | awk '{print $NF;exit}')
fi
PRIVATE_NETWORK_IP=${ADDR} mutagen-compose -f "$basedir"/docker-compose.yml down
8 changes: 7 additions & 1 deletion bin/up
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ mutagen daemon start
echo -e ${prefix}The mutagen daemon will stay running until you stop it manually with \`mutagen daemon stop\`.$suffix

echo -e ${prefix}Running mutagen-compose...$suffix
PRIVATE_NETWORK_IP=$(ifconfig -l | xargs -n1 ipconfig getifaddr) mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
IP_ADDR=$(ifconfig -l | xargs -n1 ipconfig getifaddr)
elif [[ "$OSTYPE" == "darwin"* ]]; then
IP_ADDR=$(ip route get 1 | awk '{print $NF;exit}')
fi
PRIVATE_NETWORK_IP=${ADDR} mutagen-compose -f "$basedir"/docker-compose.yml up --build --detach

0 comments on commit db81406

Please sign in to comment.