This commit is contained in:
Rob Pearce 2022-03-23 19:06:56 +11:00
parent ef2c263cd6
commit d02a243ff8
1 changed files with 9 additions and 4 deletions

13
t.sh
View File

@ -1,10 +1,13 @@
#!/bin/bash #!/bin/bash
#set -x
trap "exit 1" TERM trap "exit 1" TERM
export MYPID=$$ export MYPID=$$
. ${HOME}/code/bashtools/bashtools.sh
if [[ -z $HAVE_BASHTOOLS ]]; then if [[ -z $HAVE_BASHTOOLS ]]; then
echo "ERROR: bashtools not installed download from https://git.nethack.net/rob/bashtools" echo "ERROR: bashtools not installed download from https://git.nethack.net/rob/bashtools" >/dev/stderr
exit 1 exit 1
fi fi
@ -1476,8 +1479,10 @@ function tasksync() {
else else
noun="Sync" noun="Sync"
fi fi
notify "Syncing tasks"
res=$(${VDIRSYNCER} sync 2>&1) res=$(${VDIRSYNCER} sync 2>&1)
rv=$? rv=$?
[[ $rv -eq 0 ]] && ok || fail
if [[ $rv -eq 0 ]]; then if [[ $rv -eq 0 ]]; then
upcount=$(echo "$res" | grep -v ^Sync | grep -c ${VDS_REMOTE}) upcount=$(echo "$res" | grep -v ^Sync | grep -c ${VDS_REMOTE})
@ -1719,8 +1724,6 @@ fi
[[ -z $VDS_LOCAL ]] && VDS_LOCAL="$DEFAULT_VDS_LOCAL" [[ -z $VDS_LOCAL ]] && VDS_LOCAL="$DEFAULT_VDS_LOCAL"
[[ -z $VDS_REMOTE ]] && VDS_REMOTE="$DEFAULT_VDS_REMOTE" [[ -z $VDS_REMOTE ]] && VDS_REMOTE="$DEFAULT_VDS_REMOTE"
mode="" mode=""
for x in $valid_modes; do for x in $valid_modes; do
thisone="words_$x" thisone="words_$x"
@ -1742,8 +1745,10 @@ if [[ $mode == "sync" ]]; then
exit $rv exit $rv
fi fi
notify "Processing"
loadids || exit 1 loadids || exit 1
loadtasks || exit 1 loadtasks || exit 1
ok
[[ $TESTMODE -eq 1 ]] && exit 1 [[ $TESTMODE -eq 1 ]] && exit 1
@ -1860,7 +1865,6 @@ elif [[ $mode == "cleanup" ]]; then
fi fi
else else
# multi-task commands # multi-task commands
filter=$* filter=$*
uids="" uids=""
@ -1958,6 +1962,7 @@ else
done done
fi fi
needtitle=1 needtitle=1
if [[ -z $uids ]]; then if [[ -z $uids ]]; then
error "no matching tasks found." error "no matching tasks found."