/bin/twn: support run command for --target=web

This commit is contained in:
veclavtalica 2025-02-22 00:39:24 +03:00
parent 98d7d76a42
commit a223506a5f

11
bin/twn
View File

@ -11,7 +11,16 @@ case "$1" in
build ) "$toolpath"/twnbuild "${@:2}"
;;
run ) $0 build "${@:2}" && ./$exe
run ) $0 build "${@:2}"
if [[ "$*" == *"--target=web"* ]]; then
if [ "$OS" = "Windows_NT" ]; then
explorer "http://0.0.0.0:8000/$exe.html" & python3 -m http.server
else
xdg-open "http://0.0.0.0:8000/$exe.html" & python3 -m http.server
fi
else
./$exe
fi
;;
gdb ) unset DEBUGINFOD_URLS