Skip to content

Commit 037e909

Browse files
committed
Add temporary dir for optimizing artifacts
1 parent 183e9d4 commit 037e909

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

optimize_workspace.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ echo -n "Building artifacts in workspace..."
1313
echo "done."
1414

1515
echo -n "Optimizing artifacts in workspace..."
16-
# Start clean
17-
rm -rf ./artifacts
18-
mkdir artifacts
19-
# Optimize and postprocess artifacts
16+
mkdir -p artifacts
17+
TMPDIR=$(mktemp -d artifacts.XXX)
18+
# Optimize artifacts
2019
(
21-
cd artifacts
20+
cd "$TMPDIR"
2221

2322
for WASM in ../target/wasm32-unknown-unknown/release/*/*.wasm
2423
do
@@ -28,6 +27,12 @@ mkdir artifacts
2827
chmod -x "$BASE"
2928
echo "done."
3029
done
30+
mv "*.wasm" ../artifacts
31+
)
32+
# Postprocess artifacts
33+
(
34+
cd artifacts
3135
sha256sum -- *.wasm >checksums.txt
3236
)
37+
rm -rf "$TMPDIR"
3338
echo "done."

0 commit comments

Comments
 (0)