feat: add edit command
This commit is contained in:
parent
d3ff11220b
commit
dbfde13372
|
@ -29,7 +29,6 @@ year="$(date +%Y)"
|
|||
week="$(date -d "$base_monday" +%V)"
|
||||
|
||||
fname="${time_dir}/${year}-${week}".timedot
|
||||
current="${time_dir}/current.timedot"
|
||||
|
||||
#
|
||||
## support functions
|
||||
|
@ -87,15 +86,21 @@ case "$command" in
|
|||
echo "File exists: $fname"
|
||||
fi
|
||||
;;
|
||||
edit)
|
||||
if [[ -f $fname ]]; then
|
||||
$EDITOR "$fname"
|
||||
else
|
||||
echo "File does not exist: $fname"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Usage: generate-week.sh <command> [<args>]"
|
||||
echo ""
|
||||
echo "Commands: print, write"
|
||||
echo "Commands: print, write, edit"
|
||||
echo "Args: datestring in format: YYYY-MM-DD (+%Y-%m-%d)"
|
||||
echo ""
|
||||
echo "Generate a weekly timedot file. Week starts on Monday."
|
||||
echo "Does not print the TEMPLATE string on Sat/Sun."
|
||||
echo "Updates symlink to current.timedot in the TIME_DIR."
|
||||
echo ""
|
||||
echo "Environment variables:"
|
||||
echo "TIME_DIR Output directory, defaults to current directory."
|
||||
|
|
Loading…
Reference in a new issue