forked from Dunbaratu/LaserDist
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakePackage.sh
More file actions
66 lines (54 loc) · 2.13 KB
/
makePackage.sh
File metadata and controls
66 lines (54 loc) · 2.13 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
# 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:
# ------------------------------------------------------------
# I copied the 7-ZIP 7z.exe file into my github /usr/bin to make this work:
CMD_ZIP="7z"
CMD_ZIP_ARGS="-tzip"
# Location where your KSP game is installed:
INSTALL_GAME_DIR="../../../../../Program Files (x86)/Steam/steamapps/common/Kerbal Space Program"
# Change this to "no" if you want to suppress the install to your game:
DO_INSTALL="yes" #
# ------------------------------------------------------------
# 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/Debug/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