feat(notes): list subcommand

This commit is contained in:
Ayo Ayco 2025-06-23 18:07:36 +02:00
parent 864bc2840c
commit ec80a63e7a

View file

@ -12,8 +12,8 @@ command=$1
getopts "t" typora; #check if -t flag is given
notesSync
{
function createNote() {
{
read -p "Enter file name: " title
file_name=$title.md
full_path="${notes_dir}/${file_name}"
@ -35,7 +35,15 @@ notesSync
vim "$full_path"
fi
} || {
} || {
echo ">>> New note failed"
}
}
if [ "$1" = "list" ]; then
find $notes_dir -maxdepth 1 -type f -not -name '*~' -not -name '.gitignore' -printf '%f\n'
else
notesSync
createNote
fi
notesSync