diff --git a/reporting/qolop b/reporting/qolop index 00573f3..99eb00d 100755 --- a/reporting/qolop +++ b/reporting/qolop @@ -141,14 +141,15 @@ _qReset() { set -e case $OSTYPE in darwin*) - MYPATH=$( realpath $( dirname "$0" ) ) + MYPATH=$( realpath "$0" ) ;; *) - MYPATH=$( readlink -f $( dirname "$0" ) ) + MYPATH=$( readlink -f "$0" ) ;; esac + MYDIR=$( dirname "$MYPATH" ) QTOOLS=0 - if [[ -f "$MYPATH/../rc" ]]; then if grep -q QTOOLS "$MYPATH/../rc"; then + if [[ -f "$MYDIR/../rc" ]]; then if grep -q QTOOLS "$MYDIR/../rc"; then QTOOLS=1 fi;fi; if [[ "$QTOOLS" -eq 1 ]]; then @@ -158,10 +159,10 @@ _qReset() { TMPFILE=$( mktemp ) rm -f "$TMPFILE" wget -O "$TMPFILE" https://bitbucket.org/MoonQ/tools/raw/tip/reporting/qolop - mv "$TMPFILE" "$0" - chmod +x "$0" + mv -v "$TMPFILE" "$MYPATH" + chmod +x "$MYPATH" echo Updated - source "$0" + source "$MYPATH" _qColVersion exit 0 } # end update