Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

feat: insert newline automatically in `just addnoun`

Elijah Potterb2658b0e12d1
diff --git a/justfile b/justfile
index 1d9d65251..e08d6abf9 100644
--- a/justfile
+++ b/justfile
@@ -266,7 +266,8 @@ addnoun noun:
fi
# Echo the noun with its flags to the dictionary file
- echo "{{noun}}/$flags" >> $DICT_FILE
+ [[ -s $DICT_FILE && -n $(tail -c1 "$DICT_FILE") ]] && echo >> "$DICT_FILE"
+ echo "{{noun}}/$flags" >> "$DICT_FILE"
# Search Harper's curated dictionary for a specific word
searchdictfor word: