Update t script to add a small warning

main
Ensar Sarajčić 2025-02-01 10:36:10 +01:00
parent bd1db72dba
commit ea29d6f7ac
1 changed files with 3 additions and 0 deletions

View File

@ -125,6 +125,9 @@ if [ -z "$TIMESHEET_LEDGER_HOME" ]; then
fi
time_in () {
if echo "$PROJECT" | grep -q ".*:Client:.*:"; then
echo "WARNING: Using sub-projects per client is deprecated. Consider using just Client instead of sub-projects for easier management"
fi
LAST_ENTRY=$(grep "$PROJECT" "$TIMESHEET_LEDGER_HOME/timesheets/$(date +%Y).journal" | tail -1 | cut -f1 -d ' ')
if [ "$LAST_ENTRY" = "i" ]; then
echo "Timer for project $PROJECT was already started. Aborting..."