diff --git a/rc b/rc index cb1da57..b999c1d 100755 --- a/rc +++ b/rc @@ -13,13 +13,14 @@ export PATH function _self_update() { touch "$TOOLSPATH"/.lastupdate 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 } [[ "$1" = "-u" ]] && _self_update # Update self weekly +[[ -w "$TOOLSPATH" ]] || return [[ -t 0 ]] || return [[ -t 1 ]] || return [[ -t 2 ]] || return @@ -27,6 +28,6 @@ function _self_update() { [[ -w "$TOOLSPATH"/.lastupdate ]] || return TOOLS_LASTUPDATE=$(( $( date +%s ) - $( stat -c %Y "$TOOLSPATH"/.lastupdate ) )) -[[ "$TOOLS_LASTUPDATE" -gt 604800 ]] && _self_update +[[ "$TOOLS_LASTUPDATE" -gt 604800 ]] && _self_update unset TOOLS_LASTUPDATE unset -f _self_update