home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a2a2140
)
Make daily todo file template
author
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 29 Jul 2022 18:53:05 +0000
(14:53 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Fri, 29 Jul 2022 18:53:05 +0000
(14:53 -0400)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
d1d458a
..
193f4be
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-425,20
+425,28
@@
gh_clone_repo() {
git clone "$1"
}
git clone "$1"
}
+daily_todo_file_template() {
+cat << EOF
+===============================================================================
+$(date '+%F %A')
+===============================================================================
+
+
+backlog
+-------------------------------------------------------------------------------
+EOF
+}
+
todo() {
local date
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
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"
}
fi
cd "$DIR_TODO" && "$EDITOR" "$file"
}
This page took
0.027681 seconds
and
4
git commands to generate.