#/bin/bash function open_on_ready () { printf "Waiting for back to boot up..." until $(curl --output /dev/null --silent --head --fail http://localhost:8080/api); do printf '.' sleep 1 done printf '\nWaiting for front to boot up...' until $(curl --output /dev/null --silent --head --fail http://localhost:8080); do printf '.' sleep .2 done printf '\n' if [[ "$OSTYPE" == "darwin"* ]]; then open http://localhost:8080 else xdg-open http://localhost:8080 fi } CHUG_COMMAND_SET["open_on_ready"]="open_on_ready"