-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathmakePackage.sh
More file actions
80 lines (64 loc) · 2.56 KB
/
makePackage.sh
File metadata and controls
80 lines (64 loc) · 2.56 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
# Bash script (that should work in gitbash on Windows) that
# will crate the export ZIP file for installing the mod.
# Run with "bash makePackage.sh" from this directory.
# ------------------------------------------------------------
# CHANGE THE FOLLOWING SETTINGS FOR YOUR OWN FOLDER LOCATIONS:
# ------------------------------------------------------------
CMD_ZIP="C:/Program Files/7-Zip/7z.exe"
CMD_ZIP_ARGS="-tzip"
#MODE="Debug"
MODE="Release"
# Location where your KSP game is installed:
#INSTALL_GAME_DIR="D:/KSP mod sandbox"
#INSTALL_GAME_DIR="D:/KSP_galileo"
INSTALL_GAME_DIR="D:/SteamLibrary_2/steamapps/common/Kerbal Space Program"
# Change this to "yes" if you want to install the ZIP to your game after it gets made:
# Change this to "no" if you want to suppress the install to your game and just make the ZIP only:
DO_INSTALL="yes"
# DO_INSTALL="no"
# ------------------------------------------------------------
# YOU SHOULDN'T NEED TO ALTER THE LINES FROM HERE DOWN:
# ------------------------------------------------------------
EXPORT_DIR="./GameData"
MOD_NAME="LaserDist"
if [ -e "$EXPORT_DIR" ]
then
echo "$EXPORT_DIR exists. Clearing it out."
rm -r "$EXPORT_DIR"
fi
if [ -e "${MOD_NAME}.zip" ]
then
echo "${MOD_NAME}.zip exists. Removing it."
rm "${MOD_NAME}.zip"
fi
echo "-----------------------------------------"
echo "Staging files for ZIPping in $EXPORT_DIR."
echo "-----------------------------------------"
mkdir "$EXPORT_DIR"
mkdir "${EXPORT_DIR}/${MOD_NAME}"
cp README.md "${EXPORT_DIR}/${MOD_NAME}"
cp LICENSE "${EXPORT_DIR}/${MOD_NAME}"
cp -r Parts "${EXPORT_DIR}/${MOD_NAME}/"
cp -r LaserDist.version "${EXPORT_DIR}/${MOD_NAME}/"
mkdir "${EXPORT_DIR}/${MOD_NAME}/Plugins"
cp -r src/LaserDist/bin/${MODE}/LaserDist.dll "${EXPORT_DIR}/${MOD_NAME}/Plugins"
"$CMD_ZIP" "$CMD_ZIP_ARGS" a "${MOD_NAME}.zip" "${EXPORT_DIR}"
if [ "$DO_INSTALL" = "yes" ]
then
echo "-----------------------------------------------"
echo "ZIP File made, now installing to your KSP Game."
echo "-----------------------------------------------"
cp "${MOD_NAME}.zip" "${INSTALL_GAME_DIR}"
cd "${INSTALL_GAME_DIR}"
"$CMD_ZIP" x -y "${MOD_NAME}.zip"
rm "${MOD_NAME}.zip"
else
echo "----------------------"
echo "Skipping Install Step."
echo "----------------------"
fi
echo " -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"
echo " $MODE $MODE $MODE $MODE"
echo " -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"
echo "Zip file was made using the $MODE DLL. NOTICE! I Said $MODE"
echo " -- -- -- -- -- -- -- -- -- -- -- -- -- -- --"