did a little more personal documentation

This commit is contained in:
Tech Priest 2024-07-23 21:06:36 +00:00
parent f58ac1ddcd
commit df56737409

5
notes
View file

@ -17,9 +17,13 @@ set -e
readonly NOTES_DIRECTORY="${NOTES_DIRECTORY:-${HOME}/notes}" readonly NOTES_DIRECTORY="${NOTES_DIRECTORY:-${HOME}/notes}"
readonly NOTES_EDITOR="${EDITOR}" 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_FILE="$(date +%Y-%m).txt"
readonly NOTES_PATH="${NOTES_DIRECTORY}/${NOTES_FILE}" 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 if [ ! -d "${NOTES_DIRECTORY}" ]; then
while true; do while true; do
@ -33,6 +37,7 @@ if [ ! -d "${NOTES_DIRECTORY}" ]; then
esac esac
done done
fi fi
#doc: the ! -d checks if it does not exist then it asks if it should be made
if [ ${#} -eq 0 ]; then if [ ${#} -eq 0 ]; then
if [ -p "/dev/stdin" ]; then if [ -p "/dev/stdin" ]; then