fix to use with sveltekit

This commit is contained in:
Thiago Lagden
2023-12-11 13:34:34 -03:00
commit e14f35aff0
29 changed files with 4880 additions and 0 deletions

32
bin/helper/wait Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/sh
: ${SLEEP_LENGTH:=2}
: ${TIMEOUT_LENGTH:=60}
DIR="$(cd $(dirname $0) && pwd)"
BIN_DIR="$(cd $DIR/.. && pwd)"
# Import functions
. $BIN_DIR/helper/fn
wait_for() {
START="$(date +%s)"
echo "Waiting for $1 to listen on $2..."
while ! nc -z $1 $2; do
if [ $(($(date +%s) - $START)) -gt $TIMEOUT_LENGTH ]; then
abort "Service $1:$2 did not start within $TIMEOUT_LENGTH seconds. Aborting..."
fi
echo "sleeping"
sleep $SLEEP_LENGTH
done
}
for var in "$@"
do
host=${var%:*}
port=${var#*:}
wait_for $host $port
ok "Listening ${host}:${port}"
done
exit 0