From df56737409bba46300634d46f64d75466fe8f6b5 Mon Sep 17 00:00:00 2001 From: terrantechpriest Date: Tue, 23 Jul 2024 21:06:36 +0000 Subject: [PATCH] did a little more personal documentation --- notes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/notes b/notes index dd0a81f..d19c35f 100644 --- a/notes +++ b/notes @@ -17,9 +17,13 @@ set -e readonly NOTES_DIRECTORY="${NOTES_DIRECTORY:-${HOME}/notes}" readonly NOTES_EDITOR="${EDITOR}" +#doc: looks like readonly means the variable gets set and won't be changed later in the script. +#in this case it looks like the frist above sets the notes directory in the home directory +#and the second points to the default text editor readonly NOTES_FILE="$(date +%Y-%m).txt" readonly NOTES_PATH="${NOTES_DIRECTORY}/${NOTES_FILE}" +#doc: first one sets the file name, second indicates the path to the directory if [ ! -d "${NOTES_DIRECTORY}" ]; then while true; do @@ -33,6 +37,7 @@ if [ ! -d "${NOTES_DIRECTORY}" ]; then esac done fi +#doc: the ! -d checks if it does not exist then it asks if it should be made if [ ${#} -eq 0 ]; then if [ -p "/dev/stdin" ]; then