1
0
mirror of https://github.com/limosek/zaf.git synced 2024-11-24 03:19:05 +01:00

Repaired self-upgrade

This commit is contained in:
Lukas Macura 2016-04-08 23:26:46 +02:00
parent 8edce1bc43
commit 8dcc0e595a
2 changed files with 5 additions and 3 deletions

View File

@ -2,6 +2,7 @@
# Hardcoded variables
ZAF_VERSION="1.0"
ZAF_URL="https://github.com/limosek/zaf"
ZAF_RAW_URL="https://raw.githubusercontent.com/limosek/zaf"
############################################ Common routines

7
zaf
View File

@ -153,8 +153,8 @@ install)
;;
reinstall)
shift $(zaf_shift "$@")
shift
shift $(zaf_shift "$@")
[ -z "$1" ] && echo "$0 reinstall plugin [plugin]..."
for p in $@; do
if zaf_is_plugin "$p"; then
@ -180,15 +180,16 @@ remove)
;;
self-upgrade)
shift
shift $(zaf_shift "$@")
[ -z "$1" ] && auto=auto
zaf_os_specific zaf_check_deps zaf && zaf_err "Zaf is installed as system package. Cannot self-upgrade."
rm -rf /tmp/zaf-installer && mkdir /tmp/zaf-installer
if ! which curl >/dev/null;
then
zaf_err "Curl not found. Cannot continue. Please install it."
fi
[ -z "$1" ] && auto=auto
zaf_fetch_url $ZAF_URL/$ZAF_VERSION/install.sh | exec sh -s "$@"
zaf_fetch_url $ZAF_RAW_URL/$ZAF_VERSION/install.sh | exec sh -s $auto "$@"
exit
;;