mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-17 23:50:13 +01:00
The script uses `cd $(git rev-parse --show-toplevel)`, which fails if the path has spaces. Therefore, replaced `cd $(command)` with `cd "$(command)"` to properly handle spaces. After these changes. it prevents build failures due to incorrect path handling and improves error reporting too.
16 lines
No EOL
429 B
Bash
Executable file
16 lines
No EOL
429 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# get the repo root directory safely
|
|
REPO_ROOT="$(git rev-parse --show-toplevel)"
|
|
cd "$REPO_ROOT" || { echo "Error: Failed to change directory"; exit 1; }
|
|
|
|
cp "$(go env GOROOT)/misc/wasm/wasm_exec.js" ./docs/assets/
|
|
|
|
# build webassembly binary
|
|
GOARCH=wasm GOOS=js go build -o ./docs/assets/tplprev.wasm ./tplprev
|
|
if [ $? -ne 0 ]; then
|
|
echo "Error: WASM build failed!"
|
|
exit 1
|
|
fi
|
|
|
|
echo "WASM build successful!" |