aboutsummaryrefslogtreecommitdiff
path: root/scripts/publish-rapier.sh
blob: 8a1ab14711e180554eff39750d4341caa35354bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

tmp=$(mktemp -d)

echo "$tmp"

cp -r src "$tmp"/.
cp -r LICENSE README.md "$tmp"/.

### Publish the 2D version.
sed 's#\.\./\.\./src#src#g' crates/rapier2d/Cargo.toml > "$tmp"/Cargo.toml
currdir=$(pwd)
cd "$tmp" && cargo publish $DRY_RUN || exit 1
cd "$currdir" || exit 2


### Publish the 3D version.
sed 's#\.\./\.\./src#src#g' crates/rapier3d/Cargo.toml > "$tmp"/Cargo.toml
cp -r LICENSE README.md "$tmp"/.
cd "$tmp" && cargo publish $DRY_RUN || exit 1
cd "$currdir" || exit 2

### Publish the 2D f64 version.
sed 's#\.\./\.\./src#src#g' crates/rapier2d-f64/Cargo.toml > "$tmp"/Cargo.toml
currdir=$(pwd)
cd "$tmp" && cargo publish $DRY_RUN || exit 1
cd "$currdir" || exit 2


### Publish the 3D f64 version.
sed 's#\.\./\.\./src#src#g' crates/rapier3d-f64/Cargo.toml > "$tmp"/Cargo.toml
cp -r LICENSE README.md "$tmp"/.
cd "$tmp" && cargo publish $DRY_RUN || exit 1

rm -rf "$tmp"