From 518f7b63e72a6e4a3eb7ad56ee3cb1dd6fcaceac Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Sat, 21 Mar 2026 19:05:40 +0100 Subject: [PATCH] More consistent scripts --- kobopatch-wasm/build.sh | 2 +- kobopatch-wasm/setup.sh | 13 ------------- readerly/setup.sh | 2 +- test.sh | 5 +++++ 4 files changed, 7 insertions(+), 15 deletions(-) diff --git a/kobopatch-wasm/build.sh b/kobopatch-wasm/build.sh index 089e4a4..9d42967 100755 --- a/kobopatch-wasm/build.sh +++ b/kobopatch-wasm/build.sh @@ -27,6 +27,6 @@ echo "WASM binary size: $(du -h kobopatch.wasm | cut -f1)" echo "Copying artifacts..." mkdir -p "$DIST_DIR/wasm" cp kobopatch.wasm "$DIST_DIR/wasm/kobopatch.wasm" -cp wasm_exec.js "$SRC_DIR/js/wasm_exec.js" +cp "$(go env GOROOT)/lib/wasm/wasm_exec.js" "$SRC_DIR/js/wasm_exec.js" echo "Done." diff --git a/kobopatch-wasm/setup.sh b/kobopatch-wasm/setup.sh index 6ef0089..3a55161 100755 --- a/kobopatch-wasm/setup.sh +++ b/kobopatch-wasm/setup.sh @@ -44,20 +44,7 @@ else git checkout 6189c54 # update this as updates come out fi -echo "Copying wasm_exec.js from Go SDK..." -GOROOT="$(go env GOROOT)" -if [ -f "$GOROOT/lib/wasm/wasm_exec.js" ]; then - cp "$GOROOT/lib/wasm/wasm_exec.js" "$SCRIPT_DIR/wasm_exec.js" -elif [ -f "$GOROOT/misc/wasm/wasm_exec.js" ]; then - cp "$GOROOT/misc/wasm/wasm_exec.js" "$SCRIPT_DIR/wasm_exec.js" -else - echo "Error: could not find wasm_exec.js in Go SDK" - echo "GOROOT=$GOROOT" - exit 1 -fi - echo "" echo "Done. kobopatch source is at: $KOBOPATCH_DIR" -echo "wasm_exec.js copied to: $SCRIPT_DIR/wasm_exec.js" echo "" echo "Run ./build.sh to compile the WASM binary." diff --git a/readerly/setup.sh b/readerly/setup.sh index f54613e..5bbb497 100755 --- a/readerly/setup.sh +++ b/readerly/setup.sh @@ -17,7 +17,7 @@ if [ -z "$DOWNLOAD_URL" ] || [ "$DOWNLOAD_URL" = "null" ]; then fi echo "Downloading KF_Readerly.zip..." -curl -fSL -o "$PUBLIC_DIR/KF_Readerly.zip" "$DOWNLOAD_URL" +curl -fL --progress-bar -o "$PUBLIC_DIR/KF_Readerly.zip" "$DOWNLOAD_URL" echo " -> $(du -h "$PUBLIC_DIR/KF_Readerly.zip" | cut -f1)" echo "" diff --git a/test.sh b/test.sh index 41f9f87..eb70192 100755 --- a/test.sh +++ b/test.sh @@ -21,6 +21,11 @@ if [ ! -f "$FIRMWARE_FILE" ]; then fi fi +# Set up kobopatch WASM build dependencies if not present. +if [ ! -d "$SCRIPT_DIR/kobopatch-wasm/kobopatch-src" ]; then + "$SCRIPT_DIR/kobopatch-wasm/setup.sh" +fi + # Set up KOReader assets if not present (served by the app, not a test-only asset). if [ ! -f "$SCRIPT_DIR/web/src/koreader/koreader-kobo.zip" ]; then "$SCRIPT_DIR/koreader/setup.sh"