Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion note.bash
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ DAY=$(date +'%d')

# Set default configuration
NOTE_DIR="$HOME/notes"
NOTE_NAME="$YEAR-$MONTH-$DAY.md"
NOTE_FORMAT="md"
NOTE_NAME="$YEAR-$MONTH-$DAY.$NOTE_FORMAT"
PRINT_TOOL="cat"
organize_by_date=true

Expand Down Expand Up @@ -177,6 +178,10 @@ if (($# > 0)); then
printf "Expected additional argument <Note Filename>.\n"
exit 1
fi
pattern='\.[^.]+$'
if ! [[ "$NOTE_NAME" =~ $pattern ]]; then
NOTE_NAME="$NOTE_NAME.$NOTE_FORMAT"
fi
shift
shift
;;
Expand Down
Loading