From 1ac068b2066a75ca51e4d023c2d634971b932f7e Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 30 Nov 2020 16:08:28 +0100 Subject: Add script to publish the testbed. --- publish-testbeds.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 publish-testbeds.sh diff --git a/publish-testbeds.sh b/publish-testbeds.sh new file mode 100755 index 0000000..2b2e068 --- /dev/null +++ b/publish-testbeds.sh @@ -0,0 +1,26 @@ +#! /bin/bash + +tmp=$(mktemp -d) + +echo "$tmp" + +cp -r src "$tmp"/. +cp -r src_testbed "$tmp"/. +cp -r build "$tmp"/. +cp -r LICENSE README.md "$tmp"/. + +### Publish the 2D version. +sed 's#\.\./\.\./src#src#g' build/rapier_testbed2d/Cargo.toml > "$tmp"/Cargo.toml +sed -i 's#\.\./rapier#./build/rapier#g' "$tmp"/Cargo.toml +currdir=$(pwd) +cd "$tmp" && cargo publish +cd "$currdir" || exit + + +### Publish the 3D version. +sed 's#\.\./\.\./src#src#g' build/rapier_testbed3d/Cargo.toml > "$tmp"/Cargo.toml +sed -i 's#\.\./rapier#./build/rapier#g' "$tmp"/Cargo.toml +cp -r LICENSE README.md "$tmp"/. +cd "$tmp" && cargo publish + +rm -rf "$tmp" -- cgit