feat(notes): list subcommand
This commit is contained in:
parent
864bc2840c
commit
ec80a63e7a
1 changed files with 30 additions and 22 deletions
10
notes.sh
10
notes.sh
|
@ -12,7 +12,7 @@ command=$1
|
|||
|
||||
getopts "t" typora; #check if -t flag is given
|
||||
|
||||
notesSync
|
||||
function createNote() {
|
||||
{
|
||||
read -p "Enter file name: " title
|
||||
file_name=$title.md
|
||||
|
@ -38,4 +38,12 @@ notesSync
|
|||
} || {
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue