forked from ENSL-Modding/CompMod
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_build.sh
More file actions
executable file
·32 lines (24 loc) · 906 Bytes
/
create_build.sh
File metadata and controls
executable file
·32 lines (24 loc) · 906 Bytes
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
#!/bin/bash
build_dir="build"
build_target="$1"
shift
test "$build_target" || { echo "No build target provided!"; exit 1; }
test -d "launchpad/$build_target" || { echo "Invalid build target"; exit 1; }
# Check for outstanding commits
test -d .git && test -n "$(git status --porcelain)" && { echo "ERROR: You have outstanding commits, please commit before creating a build"; exit 1; }
# Create build_dir (removing old directories if needed)
test -d "$build_dir" && {
echo "Removing old build directory";
rm -rf "$build_dir";
}
mkdir "$build_dir"
# Copy over build data
cp launchpad/$build_target/mod.settings "$build_dir/"
cp launchpad/$build_target/preview.jpg "$build_dir/"
mkdir "$build_dir/source"
mkdir "$build_dir/output"
cp -r src/* "$build_dir/output/"
for file in LICENSE README.md; do
test -f "$file" && cp "$file" "$build_dir/output/"
done
echo "Build created in $build_dir"