binary releases
This commit is contained in:
39
rc
39
rc
@@ -30,28 +30,39 @@ function _q-tools-update-binary {
|
||||
# update self
|
||||
[[ -z "$QTOOLSPATH" ]] && return
|
||||
[[ -w "$QTOOLSPATH" ]] || return
|
||||
local foo
|
||||
echo "Updating with binary deletes the existing folder! sure? y/N"
|
||||
read foo
|
||||
[[ "$foo" = y ]] || return
|
||||
#local foo
|
||||
#echo "Updating with binary deletes the existing folder! sure? y/N"
|
||||
#read foo
|
||||
#[[ "$foo" = y ]] || return
|
||||
pushd ~ >/dev/null
|
||||
set -u
|
||||
rm -rf "$QTOOLSPATH"
|
||||
mkdir -p "$QTOOLSPATH"
|
||||
curl https://bitbucket.org/MoonQ/q-tools/get/HEAD.tar.gz | \
|
||||
tar xz --strip 1 -C "$QTOOLSPATH"
|
||||
curl -L https://six9.net/software/q-tools/current.tar.gz | \
|
||||
tar xz -C "$QTOOLSPATH"
|
||||
popd > /dev/null
|
||||
_q-tools-reload
|
||||
|
||||
}
|
||||
|
||||
function _self_update() {
|
||||
touch "$QTOOLSPATH"/.lastupdate
|
||||
pushd "$QTOOLSPATH" > /dev/null
|
||||
git remote get-url origin 2>&1 | grep -q https...bitbucket.org/MoonQ && {
|
||||
git remote set-url origin https://git.six9.net/moonq/q-tools
|
||||
}
|
||||
[[ "$1" = "-u" ]] && {
|
||||
git pull
|
||||
} || {
|
||||
timeout 10 git pull > /dev/null 2>&1
|
||||
}
|
||||
if [[ -d .git ]]; then
|
||||
git remote get-url origin 2>&1 | grep -q https.*git.six9.net && {
|
||||
_q-tools-update-binary
|
||||
popd > /dev/null
|
||||
|
||||
}
|
||||
if [[ "$1" = "-u" ]]; then
|
||||
git pull
|
||||
else
|
||||
timeout 10 git pull > /dev/null 2>&1
|
||||
fi
|
||||
else
|
||||
_q-tools-update-binary
|
||||
fi
|
||||
|
||||
popd > /dev/null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user