Make daily todo file template
authorSiraaj Khandkar <siraaj@khandkar.net>
Fri, 29 Jul 2022 18:53:05 +0000 (14:53 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Fri, 29 Jul 2022 18:53:05 +0000 (14:53 -0400)
home/lib/login_functions.sh

index d1d458a..193f4be 100644 (file)
@@ -425,20 +425,28 @@ gh_clone_repo() {
     git clone "$1"
 }
 
+daily_todo_file_template() {
+cat << EOF
+===============================================================================
+$(date '+%F %A')
+===============================================================================
+
+
+backlog
+-------------------------------------------------------------------------------
+EOF
+}
+
 todo() {
     local date
-    local timestamp
-    local bar
-    date=$(date +%F)
-    timestamp=$(date '+%F %A')
-    bar=$(for _ in {1..80}; do printf '='; done)
+    date="$(date +%F)"
     local -r dir="$DIR_TODO/daily"
     local -r file="$dir/$date.txt"
 
     mkdir -p "$dir"
     if [ ! -f "$file" ]
     then
-        printf '%s\n%s\n%s\n' "$bar" "$timestamp" "$bar" > "$file"
+        daily_todo_file_template > "$file"
     fi
     cd "$DIR_TODO" && "$EDITOR" "$file"
 }
This page took 0.01965 seconds and 4 git commands to generate.