From f5f441425435e4a2416a3e08eac3035c6f827705 Mon Sep 17 00:00:00 2001 From: Ayo Date: Mon, 23 Jun 2025 20:35:29 +0200 Subject: [PATCH] feat: validate Title for new note & task --- notes.sh | 6 ++++++ tasks.sh | 6 ++++++ 2 files changed, 12 insertions(+) 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}"