background update

This commit is contained in:
q
2016-02-26 20:06:05 +02:00
parent daacff7a1a
commit b6c2c572ad

3
rc
View File

@@ -13,13 +13,14 @@ export PATH
function _self_update() { function _self_update() {
touch "$TOOLSPATH"/.lastupdate touch "$TOOLSPATH"/.lastupdate
pushd "$TOOLSPATH" > /dev/null pushd "$TOOLSPATH" > /dev/null
timeout 5 hg pull -u > /dev/null 2>&1 timeout 5 hg pull -u > /dev/null 2>&1 &
popd > /dev/null popd > /dev/null
} }
[[ "$1" = "-u" ]] && _self_update [[ "$1" = "-u" ]] && _self_update
# Update self weekly # Update self weekly
[[ -w "$TOOLSPATH" ]] || return
[[ -t 0 ]] || return [[ -t 0 ]] || return
[[ -t 1 ]] || return [[ -t 1 ]] || return
[[ -t 2 ]] || return [[ -t 2 ]] || return