You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
traqtor/.chug/bash/.base/open_on_ready.sh

21 lines
551 B
Bash

#/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"