forked from sarbian/ModuleManager
-
Notifications
You must be signed in to change notification settings - Fork 5
/
deploy.sh
executable file
·115 lines (96 loc) · 2.44 KB
/
deploy.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/env bash
# see http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
source ./CONFIG.inc
IFS=$' '
check() {
if [ ! -d "./GameData/$TARGETBINDIR/" ] ; then
rm -f "./GameData/$TARGETBINDIR/"
mkdir -p "./GameData/$TARGETBINDIR/"
fi
for dll in $EXT_DLLS ; do
if [ ! -f "${LIB}/$dll.dll" ] ; then
echo "$dll not found!!! Aborting."
exit -1
fi
done
}
deploy_dev() {
local DLL=$1.dll
if [ -f "./bin/Release/$DLL" ] ; then
cp "./bin/Release/$DLL" "$LIB"
fi
}
deploy() {
local DLL=$1.dll
if [ -f "./bin/Release/$DLL" ] ; then
cp -R "./bin/Release/$DLL" "./GameData/$TARGETBINDIR/"
if [ -d "${KSP_DEV}/GameData/$TARGETBINDIR/" ] ; then
cp -R "./bin/Release/$DLL" "${KSP_DEV}/GameData/$TARGETBINDIR/"
fi
fi
if [ -f "./bin/Debug/$DLL" ] ; then
if [ -d "${KSP_DEV}/GameData/$TARGETBINDIR/" ] ; then
cp -R "./bin/Debug/$DLL" "${KSP_DEV}GameData/$TARGETBINDIR/"
fi
fi
}
deploy_plugindata() {
local DLL=$1.dll
if [ -f "./bin/Release/$DLL" ] ; then
cp "./bin/Release/$DLL" "./GameData/$TARGETBINDIR/PluginData/"
if [ -d "${KSP_DEV}/GameData/" ] ; then
cp "./bin/Release/$DLL" "${KSP_DEV}GameData/$TARGETBINDIR/PluginData/"
fi
fi
if [ -f "./bin/Debug/$DLL" ] ; then
if [ -d "${KSP_DEV}/GameData/" ] ; then
cp "./bin/Debug/$DLL" "${KSP_DEV}GameData/$TARGETBINDIR/PluginData/"
fi
fi
}
deploy_gamedata() {
local PLACE=$1
local DLL=$2.dll
if [ -f "./bin/Release/$DLL" ] ; then
cp "./bin/Release/$DLL" "./GameData/000_$DLL"
if [ -d "${KSP_DEV}/GameData/" ] ; then
cp "./bin/Release/$DLL" "${KSP_DEV/}GameData/${PLACE}_$DLL"
fi
fi
if [ -f "./bin/Debug/$DLL" ] ; then
if [ -d "${KSP_DEV}/GameData/" ] ; then
cp "./bin/Debug/$DLL" "${KSP_DEV}GameData/${PLACE}_$DLL"
fi
fi
}
deploy_ext() {
local DLL=$1.dll
if [ -f "$LIB/$DLL" ] ; then
cp -R "$LIB/$DLL" "./GameData/$TARGETBINDIR/"
if [ -d "${KSP_DEV}/GameData/" ] ; then
cp -R "$LIB/$DLL" "${KSP_DEV/}GameData/$TARGETBINDIR/"
fi
fi
}
check
cp $VERSIONFILE "./GameData/$TARGETDIR/"
cp CHANGE_LOG.md "./GameData/$TARGETDIR/"
cp README.md "./GameData/$TARGETDIR/"
cp LICENSE "./GameData/$TARGETDIR/"
cp NOTICE "./GameData/$TARGETDIR/"
for dll in $GD_DLLS ; do
deploy_dev $dll
deploy_gamedata $GD_PRIORITY $dll
done
for dll in $PD_DLLS ; do
deploy_plugindata $dll
done
for dll in $DLLS ; do
deploy_dev $dll
TARGETBINDIR="" deploy $dll
done
for dll in $EXT_DLLS ; do
deploy_ext $dll
done