-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·40 lines (31 loc) · 1 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·40 lines (31 loc) · 1 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
32
33
34
35
36
37
38
39
40
#!/bin/bash
# --- VARIABLES ---
MOD_NAME="SoundsOfNature"
MOD_VERSION=$(jq -r .version modinfo.json)
ZIP_NAME="$MOD_NAME-$MOD_VERSION.zip"
MODS_PATH="$HOME/.config/VintagestoryData/Mods"
STAGING_DIR="bin/staging"
echo "--- 1. CLEANING ---"
dotnet clean
rm -rf "$STAGING_DIR"
rm -f "$MOD_NAME"-*.zip "$MOD_NAME.zip"
echo "--- 2. BUILDING ---"
dotnet build
echo "--- 3. PACKAGING ---"
# Create a temporary staging area
mkdir -p "$STAGING_DIR"
# Copy essential files
cp modinfo.json "$STAGING_DIR/"
cp bin/Debug/Mods/SoundsOfNature/SoundsOfNature.dll "$STAGING_DIR/"
cp -r assets "$STAGING_DIR/"
# Include icon if present
[ -f modicon.png ] && cp modicon.png "$STAGING_DIR/"
# Zip the contents of the staging directory
cd "$STAGING_DIR"
zip -r -q ../../"$ZIP_NAME" *
cd ../..
echo "--- 4. DEPLOYING ZIP ---"
# Remove older versions of this mod, then move the zip to the game folder
rm -f "$MODS_PATH/$MOD_NAME"-*.zip "$MODS_PATH/$MOD_NAME.zip"
mv "$ZIP_NAME" "$MODS_PATH/"
echo "Deploy Complete: $MODS_PATH/$ZIP_NAME"