mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 19:04:05 +02:00
Add serve-wasm.py to the emscripten bundle
This commit is contained in:
3
.github/build.sh
vendored
3
.github/build.sh
vendored
@@ -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
|
||||
|
15
resources/serve-wasm.template.py
Normal file → Executable file
15
resources/serve-wasm.template.py
Normal file → Executable file
@@ -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
|
||||
|
Reference in New Issue
Block a user