From 9a74ba2ed40436d2c04b80f04c892815749a8237 Mon Sep 17 00:00:00 2001 From: Ahwx Date: Mon, 14 Oct 2024 10:12:33 +0200 Subject: [PATCH] feat: now open just neovim if no note is selected --- modules/home/scripts/scripts/notes.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/home/scripts/scripts/notes.sh b/modules/home/scripts/scripts/notes.sh index d7fadc5..9bd1fa9 100644 --- a/modules/home/scripts/scripts/notes.sh +++ b/modules/home/scripts/scripts/notes.sh @@ -13,6 +13,12 @@ cd "$NOTEDIR" || mkdir -p "$NOTEDIR" && cd "$NOTEDIR" || echo 'Error with moving echo "Check if connected to internet and pull changes from Git" ping -c1 github.com >/dev/null && notify-send "$(git pull)" # Pull most recent changes, be sure to not create conficts... -kitty -e nvim "$CHOSEN" # Finally open chosen note +if [ "$CHOSEN" ]; then + kitty -e nvim "$CHOSEN" # Finally open chosen note + + git add "$CHOSEN" && git commit -m "chore: updates (auto)" && git push && notify-send "Changes pushed" +else + cd "$NOTEDIR" || exit 1 + kitty -e nvim +fi -git add "$CHOSEN" && git commit -m "chore: updates (auto)" && git push && notify-send "Changes pushed"