-
Notifications
You must be signed in to change notification settings - Fork 301
/
publish_release.sh
executable file
·43 lines (33 loc) · 1.05 KB
/
publish_release.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
#!/bin/bash
DLL=JotunnModStub/bin/Release/JotunnModStub.dll
PLUGINS=JotunnModStub/Package/plugins
README=README.md
#TRANSLATIONS=Translations
VERSION=$1
# 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
# 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
if [ ! -f "$README" ]; then
echo "Error: $README does not exist or is not readable."
exit 1
fi
cp -f "$DLL" "$PLUGINS" || { echo "Error: Failed to copy $DLL"; exit 1; }
cp -f "$README" "$PLUGINS/../README.md" || { echo "Error: Failed to copy $README"; exit 1; }
#cp -rf "$TRANSLATIONS" "$PLUGINS/" || { echo "Error: Failed to copy Translations"; exit 1; }
ZIPDESTINATION="../bin/Release/JotunnModStub.$VERSION.zip"
cd "$PLUGINS/.."
if [ ! -z "$VERSION" ]; then
VERSION=".$VERSION"
fi
zip -r "$ZIPDESTINATION" .