-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.sh
More file actions
31 lines (26 loc) · 1.03 KB
/
Copy pathpackage.sh
File metadata and controls
31 lines (26 loc) · 1.03 KB
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
#!/usr/bin/env bash
set -euo pipefail
comp="${1:-}"
case "$comp" in
core) mod="modDynamicScabbards"; with_bin=1; zipname="DynamicScabbards.zip" ;;
soh) mod="mod0_DS_SOH_Patch"; with_bin=0; zipname="DynamicScabbardsSwordsOnHipPatch.zip" ;;
ahw) mod="mod0_DS_AHW_Patch"; with_bin=0; zipname="DynamicScabbardsAutoHideWeaponsForCloaks.zip" ;;
wpiao) mod="mod0_DS_WPIAO_Patch"; with_bin=0; zipname="DynamicScabbardsWearPreviewItemsAsOutfitsPatch.zip" ;;
*) echo "usage: ./package.sh <core|soh|ahw|wpiao>" >&2; exit 2 ;;
esac
root="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$root"
ver="$(sed -nE 's/^version = "([^"]+)".*/\1/p' "mods/$mod/witcherscript.toml")"
[ -n "$ver" ] || { echo "no 'version' in mods/$mod/witcherscript.toml" >&2; exit 1; }
mkdir -p dist
rel="dist/$zipname"
rm -f "$rel"
if [ "$with_bin" = 1 ]; then
zip -qr "$rel" "mods/$mod" bin
else
zip -qr "$rel" "mods/$mod"
fi
echo "Built $rel (v$ver)"
if [ -n "${GITHUB_OUTPUT:-}" ]; then
{ echo "version=$ver"; echo "zip=$rel"; } >> "$GITHUB_OUTPUT"
fi