Skip to content

Commit f4cd01e

Browse files
committed
reinstate bak files as they are mandatory on mac
1 parent 4f6daf7 commit f4cd01e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

builds/prepare_builds/templates/build_rust.sh.tera

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ cargo clean
66
RUSTFLAGS='{{ additional_rust_flags }}' {% else -%}
77
{%- endif -%} npx wasm-pack build
88

9-
sed -i 's#dimforge_rapier#@dimforge/rapier#g' pkg/package.json
10-
sed -i 's/"rapier_wasm{{ dimension }}d_bg.wasm"/"*"/g' pkg/package.json
9+
sed -i.bak 's#dimforge_rapier#@dimforge/rapier#g' pkg/package.json
10+
sed -i.bak 's/"rapier_wasm{{ dimension }}d_bg.wasm"/"*"/g' pkg/package.json
1111
(
1212
cd pkg
1313
npm pkg delete sideEffects
1414
npm pkg set 'sideEffects[0]'="./*.js"
1515
)
16+
rm pkg/*.bak
1617
rm pkg/.gitignore

builds/prepare_builds/templates/build_typescript.sh.tera

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ rm -f ./pkg/raw.ts
66
echo 'export * from "./rapier_wasm{{ dimension }}d"' > pkg/src/raw.ts
77
# See https://serverfault.com/a/137848
88
{% for condition_to_remove in conditions_to_remove %}
9-
find pkg/ -type f -print0 | LC_ALL=C xargs -0 sed -i '\:#if {{condition_to_remove}}:,\:#endif:d'
9+
find pkg/ -type f -print0 | LC_ALL=C xargs -0 sed -i.bak '\:#if {{condition_to_remove}}:,\:#endif:d'
1010
{% endfor %}
1111
npx tsc
1212
# NOTE: we keep the typescripts files into the NPM package for source mapping: see #3
13-
sed -i 's/"module": "rapier_wasm{{ dimension }}d.js"/"module": "rapier.js"/g' pkg/package.json
14-
sed -i 's/"types": "rapier_wasm{{ dimension }}d.d.ts"/"types": "rapier.d.ts"/g' pkg/package.json
13+
sed -i.bak 's/"module": "rapier_wasm{{ dimension }}d.js"/"module": "rapier.js"/g' pkg/package.json
14+
sed -i.bak 's/"types": "rapier_wasm{{ dimension }}d.d.ts"/"types": "rapier.d.ts"/g' pkg/package.json
15+
find pkg/ -type f -name '*.bak' | xargs rm

rapier-compat/gen_src.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ cp -r ./src${DIM}/* $GENOUT
3636

3737
for condition_to_remove in "${conditions_to_remove}" ; do
3838
# See https://serverfault.com/a/137848
39-
echo "find ${GENOUT} -type f -print0 | LC_ALL=C xargs -0 sed -i \"\\:#if ${condition_to_remove}:,\\:#endif:d\""
40-
find ${GENOUT} -type f -print0 | LC_ALL=C xargs -0 sed -i "\\:#if ${condition_to_remove}:,\\:#endif:d"
39+
echo "find ${GENOUT} -type f -print0 | LC_ALL=C xargs -0 sed -i.bak \"\\:#if ${condition_to_remove}:,\\:#endif:d\""
40+
find ${GENOUT} -type f -print0 | LC_ALL=C xargs -0 sed -i.bak "\\:#if ${condition_to_remove}:,\\:#endif:d"
4141
done
4242

4343
rm -rf ./builds/${js_package_name}/pkg/
@@ -53,4 +53,7 @@ cp ./tsconfig.common.json ./tsconfig.json ./builds/${js_package_name}/
5353
cp ./tsconfig.pkg${dimension}d.json ./builds/${js_package_name}/tsconfig.pkg.json
5454

5555
# "import.meta" causes Babel to choke, but the code path is never taken so just remove it.
56-
sed -i 's/import.meta.url/"<deleted>"/g' ./builds/${js_package_name}/pkg/rapier_wasm${dimension}d.js
56+
sed -i.bak 's/import.meta.url/"<deleted>"/g' ./builds/${js_package_name}/pkg/rapier_wasm${dimension}d.js
57+
58+
# Clean up backup files.
59+
find ./builds/${js_package_name}/ -type f -name '*.bak' | xargs rm

0 commit comments

Comments
 (0)