forked from atar-axis/xpadneo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
update.sh
executable file
·37 lines (31 loc) · 1.08 KB
/
update.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
#!/bin/bash
cd "$(dirname "$0")" || exit 1
source "lib/installer.sh"
LATEST=$(get_upstream_version_latest)
reinstall() {
if [[ "${VERSION}" == "${INSTALLED[0]}" ]]; then
echo "You have already installed ${VERSION}!"
else
echo "* uninstalling outdated modules"
./uninstall.sh
echo "* installing latest version"
./install.sh
fi
}
if [[ "${LATEST}" == "${VERSION}" ]]; then
echo "Looks like the repo is up to date, fine!"
reinstall
elif __version_lte "${LATEST}" "${VERSION}"; then
echo "Looks like you are on a developer version, reinstalling!"
reinstall
else
echo "Latest stable version: ${LATEST}"
echo "Installed versions: ${INSTALLED[*]}"
echo "Repository version: ${VERSION}"
if [[ "${GIT_ROOT}" != "" ]]; then
echo "Please update this directory by running 'git reset --hard' and 'git pull', afterwards run this script again"
else
echo "Please update this directory by downloading the latest version from https://github.com/atar-axis/xpadneo/archive/${LATEST}.tar.gz"
fi
exit 1
fi