forked from endlessm/moddable-platformer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·40 lines (29 loc) · 1.07 KB
/
package.sh
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
36
37
38
39
#!/bin/bash
cargo build --target x86_64-pc-windows-gnu || exit 1
cargo build --target aarch64-apple-darwin || exit 1
# Create export directory
export_dir="/tmp/godot-export"
rm -rf "$export_dir"
mkdir -p "$export_dir"
# Copy current directory contents, excluding certain paths
rsync -av --exclude='target' \
--exclude='*.zip' \
--exclude='.git' \
--exclude='.gitignore' \
./ "$export_dir/"
# Create target directory structure
mkdir -p "$export_dir/target/x86_64-pc-windows-gnu/debug"
# Copy only top-level Windows debug files
find ./target/x86_64-pc-windows-gnu/debug -maxdepth 1 -type f -exec cp {} "$export_dir/target/x86_64-pc-windows-gnu/debug/" \;
# Copy only top-level debug files
mkdir -p "$export_dir/target/debug"
find ./target/debug -maxdepth 1 -type f -exec cp {} "$export_dir/target/debug/" \;
# zip up project in tmp folder
cd "$export_dir"
zip -r "patchwork.zip" ./*
# Return to original directory
cd -
# Copy zip from export directory to current directory
cp "$export_dir/patchwork.zip" .
# Clean up export directory
rm -rf "$export_dir"