diff --git a/.github/build.sh b/.github/build.sh index 494fbb0de..3744e41fb 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -521,7 +521,8 @@ if [[ $BSH_HOST_PLATFORM == darwin ]]; then exit 1 fi elif [[ $PACKAGE_MODE == emscripten ]]; then - tar cvf $ASSET_PATH $APP_EXE.js $APP_EXE.wasm + cp resources/serve-wasm.py . + tar cvf $ASSET_PATH $APP_EXE.js $APP_EXE.wasm serve-wasm.py elif [[ $PACKAGE_MODE == appimage ]]; then # so far this can only happen with $BSH_HOST_PLATFORM-$BSH_HOST_LIBC == linux-gnu, but this may change later case $BSH_HOST_ARCH in diff --git a/resources/serve-wasm.template.py b/resources/serve-wasm.template.py old mode 100644 new mode 100755 index f305f6b20..c2d6c8dac --- a/resources/serve-wasm.template.py +++ b/resources/serve-wasm.template.py @@ -1,3 +1,5 @@ +#!/usr/bin/python + from OpenSSL import crypto import http.server import json @@ -7,12 +9,13 @@ import ssl import sys import time -( - script, - build_root, -) = sys.argv - -os.chdir(build_root) +if len(sys.argv) >= 2: + # chdir if invoked through meson; assume that we're in the correct dir already otherwise + ( + script, + build_root, + ) = sys.argv + os.chdir(build_root) HTTP_HOST = '127.0.0.1' HTTP_PORT = 8000