|
@@ -1,7 +1,8 @@
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
run() {
|
|
|
- output=`{ timeout 10 python3 $1; } 2>&1`
|
|
|
+ [[ ${1##*.} == "py" ]] && cmd_prefix="python3" || cmd_prefix=""
|
|
|
+ output=$({ timeout 10 $cmd_prefix $1; } 2>&1)
|
|
|
exitcode=$?
|
|
|
test $exitcode -eq 124 && exitcode=0 # exitcode 124 is comming from "timeout command above"
|
|
|
echo $output | grep -e "NiceGUI ready to go" -e "Uvicorn running on http://0.0.0.0:8000" > /dev/null || exitcode=1
|
|
@@ -27,12 +28,12 @@ check() {
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
-error=0
|
|
|
check main.py || error=1
|
|
|
for path in examples/*
|
|
|
do
|
|
|
- if test -f $path/main.py
|
|
|
- then
|
|
|
+ if test -f $path/start.sh; then
|
|
|
+ check $path/start.sh || error=1
|
|
|
+ elif test -f $path/main.py; then
|
|
|
check $path/main.py || error=1
|
|
|
fi
|
|
|
done
|