From dc18e77382d7b449922625b090cda371d7f45fd6 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Mon, 16 Mar 2026 16:46:12 +0100 Subject: [PATCH] Fix setup script --- kobopatch-wasm/setup.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/kobopatch-wasm/setup.sh b/kobopatch-wasm/setup.sh index 5baac43..96fa131 100755 --- a/kobopatch-wasm/setup.sh +++ b/kobopatch-wasm/setup.sh @@ -15,15 +15,23 @@ fi echo "Copying wasm_exec.js from Go SDK..." GOROOT="$(go env GOROOT)" -WASM_EXEC="$(find "$GOROOT" "$(go env GOPATH 2>/dev/null || echo /root/go)" /usr/local/go -name "wasm_exec.js" 2>/dev/null | head -1)" +GOPATH="$(go env GOPATH 2>/dev/null || echo "")" +WASM_EXEC="" +for dir in "$GOROOT" "$GOPATH" /usr/local/go; do + [ -z "$dir" ] && continue + [ -d "$dir" ] || continue + found="$(find "$dir" -name "wasm_exec.js" 2>/dev/null | head -1)" || true + if [ -n "$found" ]; then + WASM_EXEC="$found" + break + fi +done if [ -n "$WASM_EXEC" ]; then echo "Found wasm_exec.js at: $WASM_EXEC" cp "$WASM_EXEC" "$SCRIPT_DIR/wasm_exec.js" else echo "Error: could not find wasm_exec.js in Go SDK" echo "GOROOT=$GOROOT" - echo "Contents of GOROOT:" - ls -la "$GOROOT" 2>/dev/null || true exit 1 fi