Skip to content

Commit db6eeaf

Browse files
committed
Add days script
1 parent 579b9e1 commit db6eeaf

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

days

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
START_DATE="1997-08-31"
4+
DAYS_DIR="."
5+
6+
days_since=$((($(date +%s)-$(date -jf "%Y-%m-%d" $START_DATE +%s))/86400))
7+
8+
day_file=$(printf "%05d" $days_since).md
9+
10+
if [ ! -f $DAYS_DIR/$day_file ]; then
11+
echo "# $(date +%Y-%m-%d)" > $DAYS_DIR/$day_file
12+
fi
13+
14+
$EDITOR $DAYS_DIR/$day_file
15+

0 commit comments

Comments
 (0)