Initial commit
This commit is contained in:
28
tools/package.sh
Normal file
28
tools/package.sh
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
host_target="$(rustc -vV | sed -n 's/^host: //p')"
|
||||
target="${1:-$host_target}"
|
||||
case "$target" in
|
||||
''|*[!a-zA-Z0-9_-]*) printf 'Invalid target: %s\n' "$target" >&2; exit 1 ;;
|
||||
esac
|
||||
target_dir="${CARGO_TARGET_DIR:-target}"
|
||||
case "$target" in
|
||||
*-windows-*) executable=first_person_maze.exe ;;
|
||||
*) executable=first_person_maze ;;
|
||||
esac
|
||||
if [ "$target" = "$host_target" ]; then
|
||||
cargo build --release --locked
|
||||
binary="$target_dir/release/$executable"
|
||||
else
|
||||
cargo build --release --locked --target "$target"
|
||||
binary="$target_dir/$target/release/$executable"
|
||||
fi
|
||||
destination="release/$target/first_person_maze"
|
||||
test -f "$binary"
|
||||
rm -rf "$destination"
|
||||
mkdir -p "$destination/assets/audio"
|
||||
cp "$binary" "$destination/"
|
||||
cp assets/audio/*.wav "$destination/assets/audio/"
|
||||
cp README.md "$destination/"
|
||||
printf 'Package: %s\n' "$destination"
|
||||
Reference in New Issue
Block a user