From 17df35dc088c9b1b159c2b78d8330fa9cc9a672a Mon Sep 17 00:00:00 2001 From: filip <“filip.rabiega@gmail.com”> Date: Wed, 21 Jan 2026 23:42:15 +0100 Subject: reformat most scripts --- newnote | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'newnote') diff --git a/newnote b/newnote index e0bd2a3..d9f85cc 100755 --- a/newnote +++ b/newnote @@ -4,20 +4,20 @@ dir="$OBSIDIAN_HOME" newnote() { - file="$dir/$1.md" - [ -f "$file" ] && { - echo "Note with the same name already exists, exiting" >&2 - exit 1 - } - touch "$file" && "$EDITOR" +2 "$file" - if [ "$(wc -l "$file" | awk '{print $1}')" -lt 2 ]; then - rm -f "$file" - fi + file="$dir/$1.md" + [ -f "$file" ] && { + echo "Note with the same name already exists, exiting" >&2 + exit 1 + } + touch "$file" && "$EDITOR" +2 "$file" + if [ "$(wc -l "$file" | awk '{print $1}')" -lt 2 ]; then + rm -f "$file" + fi } [ "$#" -ne 1 ] && { - echo "Usage: newnote " >&2 - exit 1 + echo "Usage: newnote " >&2 + exit 1 } newnote "$1" -- cgit v1.2.3