binary updater, no errors ffrom fastdu

This commit is contained in:
2017-12-18 15:09:55 +02:00
parent f3634ce68a
commit 752a7ca645
2 changed files with 30 additions and 13 deletions

39
rc
View File

@@ -14,19 +14,36 @@ PATH=$PATH:"$QTOOLSPATH"/bin
. "$QTOOLSPATH"/qcd_function
path_remove_duplicates
[[ -f "$QTOOLSPATH"/tsv/tsvkit.sh ]] && . "$QTOOLSPATH"/tsv/tsvkit.sh &>/dev/null
function _q-tools-reload {
# reload self
[[ -z "$QTOOLSPATH" ]] && return
source "$QTOOLSPATH"/rc
}
function _q-tools-update {
# update self
[[ -z "$QTOOLSPATH" ]] && return
[[ -w "$QTOOLSPATH" ]] || return
"$QTOOLSPATH"/rc -u
_q-tools-reload
function _q-tools-reload {
# reload self
[[ -z "$QTOOLSPATH" ]] && return
source "$QTOOLSPATH"/rc
}
function _q-tools-update {
# update self
[[ -z "$QTOOLSPATH" ]] && return
[[ -w "$QTOOLSPATH" ]] || return
"$QTOOLSPATH"/rc -u
_q-tools-reload
}
function _q-tools-update-binary {
# update self
[[ -z "$QTOOLSPATH" ]] && return
[[ -w "$QTOOLSPATH" ]] || return
[[ -f "$QTOOLSPATH"/.hg_archival.txt ]] || return
local foo
echo "Updating with binary deletes the existing folder! sure? y/N"
read foo
[[ "$foo" = y ]] || return
rm -rf "$QTOOLSPATH"
mkdir -p "$QTOOLSPATH"
curl https://bitbucket.org/MoonQ/tools/get/tip.tar.gz | \
tar xz --strip 1 -C "$QTOOLSPATH"
_q-tools-reload
}
function _self_update() {
touch "$QTOOLSPATH"/.lastupdate