-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev_deploy.sh
executable file
·65 lines (53 loc) · 1.91 KB
/
dev_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
#!/usr/bin/env sh
export WARCRAFT_MAC_ADDON_HOME="/Applications/World of Warcraft/_retail_/Interface/Addons"
export WARCRAFT_WIN_ADDON_HOME="/mnt/e/World of Warcraft/_retail_/Interface/addons"
export WARCRAFT_ADDON_HOME=""
export AKA_INSTALL_DIRECTORY=""
export AKA_STAGING_DIRECTORY="AKA"
export AKA_DEV_ARCHIVE_NAME="AKA-SNAPSHOT.zip"
if [ -d "${WARCRAFT_MAC_ADDON_HOME}" ]; then
echo "Mac addon installation detected"
WARCRAFT_ADDON_HOME="${WARCRAFT_MAC_ADDON_HOME}"
echo "\n"
fi
if [ -d "${WARCRAFT_WIN_ADDON_HOME}" ]; then
echo "Windows addon installation detected"
WARCRAFT_ADDON_HOME="${WARCRAFT_WIN_ADDON_HOME}"
echo "\n"
fi
AKA_INSTALL_DIRECTORY="${WARCRAFT_ADDON_HOME}/AKA"
if [ -d "${AKA_INSTALL_DIRECTORY}" ]; then
echo "'${AKA_INSTALL_DIRECTORY}' exists, removing for fresh deploy"
rm -rfv "${AKA_INSTALL_DIRECTORY}"
echo "\n"
fi
if [ -d "${AKA_STAGING_DIRECTORY}" ]; then
echo "'${AKA_STAGING_DIRECTORY}' exists; left over from stale build?"
rm -rfv "${AKA_STAGING_DIRECTORY}"
echo "\n"
fi
echo "Creating staging directory '${AKA_STAGING_DIRECTORY}'"
mkdir -v "${AKA_STAGING_DIRECTORY}"
echo "\n"
if [ -d "${AKA_STAGING_DIRECTORY}" ]; then
echo "Installing snapshot into staging directory '${AKA_STAGING_DIRECTORY}':"
cp -v src/AKA.* "${AKA_STAGING_DIRECTORY}"
cp -v src/localization.* "${AKA_STAGING_DIRECTORY}"
cp -v *.txt "${AKA_STAGING_DIRECTORY}"
echo "\n"
echo "Installing snapshot into installation directory '${AKA_INSTALL_DIRECTORY}':"
cp -Rv ${AKA_STAGING_DIRECTORY} "${WARCRAFT_ADDON_HOME}"
echo "\n"
else
echo "'${AKA_STAGING_DIRECTORY}' doesn't seem to exist?"
exit -1
fi
echo "Creating AddOn archive of snapshot"
zip -r ${AKA_DEV_ARCHIVE_NAME} ${AKA_STAGING_DIRECTORY}
echo "\n"
if [ -d "${AKA_STAGING_DIRECTORY}" ]; then
echo "Cleaning up staging directory"
rm -rfv ${AKA_STAGING_DIRECTORY}
echo "\n"
fi
echo "Deploy completed at `date +"%a, %d %b %Y %H:%M:%S %z"`."