generated from Valheim-Modding/JotunnModStub
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
publish_debug.sh
executable file
·48 lines (39 loc) · 1.52 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
#!/bin/bash
DEBUGDIR=ChebsMythicalWeapons/bin/Debug/net48
DLL=$DEBUGDIR/ChebsMythicalWeapons.dll
LIB=$DEBUGDIR/ChebsValheimLibrary.dll
BUN=chebs-mythical-weapons-unity/Assets/AssetBundles/chebsmythicalweapons
#PLUGINS=/home/$USER/.local/share/Steam/steamapps/common/Valheim/BepInEx/plugins
PLUGINS=/home/$USER/.config/r2modmanPlus-local/Valheim/profiles/cheb-development/BepInEx/plugins/ChebGonaz-ChebsMythicalWeapons
TRANSLATIONS=Translations
# 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
if [ ! -d "$TRANSLATIONS" ]; then
echo "Error: $TRANSLATIONS 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; }
cp -f "$BUN.manifest" "$PLUGINS" || { echo "Error: Failed to copy $BUN.manifest"; exit 1; }
cp -rf "$TRANSLATIONS" "$PLUGINS" || { echo "Error: Failed to copy $TRANSLATIONS"; exit 1; }