diff --git a/notes.sh b/notes.sh index d6bf9c1..c650df0 100755 --- a/notes.sh +++ b/notes.sh @@ -28,6 +28,12 @@ function editFile() { function createNote() { { read -p "Create new note: " title + + if [ "$title" = "" ]; then + echo "Title cannot be empty." + exit; + fi; + file_name=$title.md full_path="${notes_dir}/${file_name}" diff --git a/tasks.sh b/tasks.sh index 99aa737..b209173 100755 --- a/tasks.sh +++ b/tasks.sh @@ -29,6 +29,12 @@ function editFile() { function createTask() { { read -p "Create new task: " title + + if [ "$title" = "" ]; then + echo "Title cannot be empty." + exit; + fi; + file_name=$title.md full_path="${tasks_dir}/${file_name}"