[bin] Rework org-get-current-clock-task to no longer show double entries

This commit is contained in:
Sebastian Schulze 2022-07-29 15:43:22 +02:00
parent a1acb6e6ec
commit 33ca329787
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
1 changed files with 8 additions and 5 deletions

View File

@ -1,16 +1,19 @@
#!/usr/bin/env bash
set -eo pipefail
FILE="/run/user/1000/org/current-task"
message=$(cat ${FILE} 2>/dev/null)
exit_code=0
if [ ! -f $FILE ]; then
message="No file found";
exit_code=1;
fi;
else
message=$(cat ${FILE} 2>/dev/null)
if grep chilling $FILE; then
exit_code=1
fi
if grep chilling $FILE > /dev/null; then
exit_code=1
fi
fi;
echo $message
exit $exit_code