From e2a5d2db15b1cd4974a6794852a1d61971e9cff4 Mon Sep 17 00:00:00 2001 From: spinach <19keegandeppe@gmail.com> Date: Sun, 29 Jan 2023 17:14:23 -0500 Subject: [PATCH] removed extension, added directory creation --- timetracker.sh => timetracker | 5 +++++ 1 file changed, 5 insertions(+) rename timetracker.sh => timetracker (97%) diff --git a/timetracker.sh b/timetracker similarity index 97% rename from timetracker.sh rename to timetracker index 0ab2a9b..a650f8d 100755 --- a/timetracker.sh +++ b/timetracker @@ -26,6 +26,11 @@ TIMESHEET=$(ls "$TIMESHEET_DIR" | grep ".csv") # generated by clock in CURRENT_SESSION="$TIMESHEET_DIR/.session" +# creates directory on fresh installs +if [[ ! -d "$WORKING_DIR" ]] ; then + mkdir -p "$WORKING_DIR" +fi + createTimesheet() { payperiods=$((($(date +%s) - $(date -d "Dec-30-22" +%s)) / (14*24*3600))) period_end=$(date -d "Dec-30-22 + $((($payperiods + 1) * 14)) days" +%b-%d-%y)