-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
88 lines (76 loc) · 2.4 KB
/
build.sh
File metadata and controls
88 lines (76 loc) · 2.4 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# Build script for Nuclear Option COIL Laser Mod (Linux/Mac)
echo "========================================"
echo "Nuclear Option COIL Laser Mod Builder"
echo "========================================"
echo ""
# Check if NUCLEAR_OPTION_DIR is set
if [ -z "$NUCLEAR_OPTION_DIR" ]; then
echo "ERROR: NUCLEAR_OPTION_DIR environment variable not set!"
echo ""
echo "Please set it to your Nuclear Option installation directory:"
echo " export NUCLEAR_OPTION_DIR=\"\$HOME/.steam/steam/steamapps/common/Nuclear Option\""
echo ""
echo "Add it to your ~/.bashrc or ~/.zshrc to make it permanent."
exit 1
fi
echo "Game Directory: $NUCLEAR_OPTION_DIR"
echo ""
# Check if game directory exists
if [ ! -d "$NUCLEAR_OPTION_DIR" ]; then
echo "ERROR: Game directory does not exist!"
echo "Path: $NUCLEAR_OPTION_DIR"
echo ""
echo "Please verify your NUCLEAR_OPTION_DIR environment variable."
exit 1
fi
# Check if BepInEx is installed
if [ ! -d "$NUCLEAR_OPTION_DIR/BepInEx" ]; then
echo "WARNING: BepInEx folder not found!"
echo "Please install BepInEx before using this mod."
echo ""
echo "Download from: https://github.com/BepInEx/BepInEx/releases"
echo ""
read -p "Press Enter to continue..."
fi
# Navigate to project directory
cd "$(dirname "$0")/NuclearOptionCOILMod"
echo "Building COIL Laser Mod..."
echo ""
# Restore dependencies
echo "[1/3] Restoring NuGet packages..."
dotnet restore
if [ $? -ne 0 ]; then
echo "ERROR: Failed to restore packages!"
exit 1
fi
echo ""
# Build in Release mode
echo "[2/3] Building in Release mode..."
dotnet build -c Release
if [ $? -ne 0 ]; then
echo "ERROR: Build failed!"
exit 1
fi
echo ""
# Copy to plugins folder
echo "[3/3] Copying to BepInEx plugins folder..."
if [ ! -d "$NUCLEAR_OPTION_DIR/BepInEx/plugins" ]; then
echo "Creating plugins folder..."
mkdir -p "$NUCLEAR_OPTION_DIR/BepInEx/plugins"
fi
cp -f "bin/Release/net46/NuclearOptionCOILMod.dll" "$NUCLEAR_OPTION_DIR/BepInEx/plugins/"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to copy DLL!"
exit 1
fi
echo ""
echo "========================================"
echo "Build Complete!"
echo "========================================"
echo ""
echo "DLL Location: $NUCLEAR_OPTION_DIR/BepInEx/plugins/NuclearOptionCOILMod.dll"
echo ""
echo "You can now launch Nuclear Option to test the mod."
echo "Check BepInEx console for loading messages."
echo ""