-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
publish_debug.sh
executable file
·59 lines (50 loc) · 1.7 KB
/
publish_debug.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
DEBUGDIR=ChebsNecromancy/bin/Debug/net48
DLL=$DEBUGDIR/ChebsNecromancy.dll
LIB=$DEBUGDIR/ChebsValheimLibrary.dll
BUN=chebs-necromancy-unity/Assets/AssetBundles/chebgonaz
#PLUGINS=/home/joshua/.local/share/Steam/steamapps/common/Valheim/BepInEx/plugins
PLUGINS=/home/$USER/.config/r2modmanPlus-local/Valheim/profiles/cheb-development/BepInEx/plugins/ChebGonaz-ChebsNecromancy
# Check that source files exist and are readable
if [ ! -f "$DLL" ]; then
echo "Error: $DLL does not exist or is not readable."
exit 1
fi
if [ ! -f "$LIB" ]; then
echo "Error: $LIB does not exist or is not readable."
exit 1
fi
if [ ! -f "$BUN" ]; then
echo "Error: $BUN does not exist or is not readable."
exit 1
fi
# Check that target directory exists and is writable
if [ ! -d "$PLUGINS" ]; then
echo "Error: $PLUGINS directory does not exist."
exit 1
fi
if [ ! -w "$PLUGINS" ]; then
echo "Error: $PLUGINS directory is not writable."
exit 1
fi
cp -f "$DLL" "$PLUGINS" || { echo "Error: Failed to copy $DLL"; exit 1; }
cp -f "$LIB" "$PLUGINS" || { echo "Error: Failed to copy $LIB"; exit 1; }
cp -f "$BUN" "$PLUGINS" || { echo "Error: Failed to copy $BUN"; exit 1; }
# merging causes problems with the mods when installed together, so I'm disabling this
#
# create dir if not existing
#if [ ! -d "$DEBUGDIR/merged" ]; then
# mkdir $DEBUGDIR/merged
#fi
#
#cp -f $BEPINEX $DEBUGDIR
#cd $DEBUGDIR
#
#mono ../../../packages/ILRepack.2.0.18/tools/ILRepack.exe /out:merged/ChebsNecromancy.dll $(basename "$LIB") $(basename "$DLL")
#
#if [ $? != 0 ]; then
# echo "Merging failed"
# exit 1
#fi
#
#cp -f "merged/ChebsNecromancy.dll" "$PLUGINS" || { echo "Error: Failed to copy merged dll"; exit 1; }