Closed thomasabishop closed 2 years ago
Very cool, I will check it later!
Renamed dir, script and readme.
I made some changes:
I removed some obvious and/or little interesting lines. The TOKEN
var should contain the pure token only. In that way you can't change the script by mistake and is easier to understand.
Some additional things:
Thank you for your feedback.
#
as contributors to other scripts have done. My idea would something like this:
#!/bin/sh
TOKEN=""
wakatime_today="$(curl -sf --header "Authorization: Basic $(echo "$TOKEN" | base64)" https://wakatime.com/api/v1/users/current/status_bar/today)"
if [ -n "$wakatime_today" ]; then
echo "#1 $(wakatime_today | jq -r '.data.grand_total.text')"
else
echo "#2"
fi
Can you test it?
Thanks for your help. Your formulation generated the following error:
./info-wakatime.sh: line 14: wakatime_today: command not found
I have adapted it to resolve this error whilst maintaining the conditional and hash outputs. I have tested and works fine.
Welcome to your first script here :sunglasses:
Great! Thank you for your help with this ☺️
Hi I've made a clean pull request for this script. It takes account of previous feedback regarding unsatisfactory security options.