From 6ced96a42e8884053230d72a590e96c3cb6e2333 Mon Sep 17 00:00:00 2001 From: Olivier Chafik Date: Wed, 17 Jul 2024 14:15:19 +0100 Subject: [PATCH] fix build-openscad-wasm.sh docker won't mount files outside home directory --- build-openscad-wasm.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/build-openscad-wasm.sh b/build-openscad-wasm.sh index 55692fa..0ba0c19 100755 --- a/build-openscad-wasm.sh +++ b/build-openscad-wasm.sh @@ -2,7 +2,7 @@ set -euo pipefail if [ -z "${OPENSCAD_DIR:-}" ]; then - OPENSCAD_DIR=/tmp/openscad-color + OPENSCAD_DIR=~/tmp/openscad-color if [ ! -d "$OPENSCAD_DIR" ]; then rm -fR "$OPENSCAD_DIR" git clone --recurse https://github.com/ochafik/openscad.git \ @@ -11,11 +11,10 @@ if [ -z "${OPENSCAD_DIR:-}" ]; then fi fi -( cd "$OPENSCAD_DIR" && - docker run --rm -it -v "$PWD":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \ - emcmake cmake -B build -DEXPERIMENTAL=ON "$@" && \ - docker run --rm -it -v "$PWD":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \ - cmake --build build -j10 ) +docker run --rm -it -v "$OPENSCAD_DIR":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \ + emcmake cmake -B build -DEXPERIMENTAL=ON "$@" && \ +docker run --rm -it -v "$OPENSCAD_DIR":/src:rw --platform=linux/amd64 openscad/wasm-base:latest \ + cmake --build build -j10 rm -fR libs/openscad-wasm mkdir -p libs/openscad-wasm @@ -23,4 +22,4 @@ mkdir -p libs/openscad-wasm cp "$OPENSCAD_DIR/build/openscad.wasm" libs/openscad-wasm/ cp "$OPENSCAD_DIR/build/openscad.js" libs/openscad-wasm/ cp "$OPENSCAD_DIR/build/openscad.wasm.map" libs/openscad-wasm/ || true -( cd libs && zip -r ../dist/openscad-wasm.zip openscad-wasm ) \ No newline at end of file +( cd libs && zip -r ../dist/openscad-wasm.zip openscad-wasm )