Skip to content

Commit

Permalink
Bugs fixed, stable release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
novusnota committed Jan 28, 2021
1 parent b1ea6a4 commit 98ae3e6
Showing 1 changed file with 35 additions and 2 deletions.
37 changes: 35 additions & 2 deletions notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ readonly NOTES_D="${NOTES_DATE[2]}"
##
# EDIT: Change this to your favourite text file format
##
readonly NOTES_FORMAT='.md'
readonly NOTES_FORMAT='md'

##
# EDIT: Remove this section, if you've already set EDITOR, or don't want to use (Neo)Vim.
Expand All @@ -67,7 +67,7 @@ if [ -z "$(which nvim)" ]; then
fi
fi

readonly NOTES_EDITOR="${EDITOR:-"$vimVariant"}"
readonly NOTES_EDITOR="${EDITOR:-"$vimDerivative"}"
##
# ^^^^
# EDIT: Remove this section, if you've already set EDITOR, or don't want to use (Neo)Vim.
Expand Down Expand Up @@ -111,6 +111,39 @@ if [ $(cat "${NOTES_PATH}" | grep -c '\S') -lt 1 ]; then
prefix=''
fi

##
# Debugging section
# vvvvvvv
##
echoList() {
local args=("$@")
for arg in "${args[@]}"; do
echo "$arg"
done
}

logAndExit() {
echoList \
"Directory: $NOTES_DIRECTORY" \
"File: $NOTES_FILE" \
"Format: $NOTES_FORMAT" \
"Path: $NOTES_PATH" \
"Editor: $NOTES_EDITOR" \
"Prefix: $prefix"
exit 0
}

# Print out most of variables to visually
# check their values and exit before
# trying to write a note somewhere
# (not an autotest, I know :)
#logAndExit

##
# ^^^^^^^
# Debugging section
##

##
# Try to get arguments from stdin and append them OR launch an editor directly
# Otherwise, append current arguments to the file
Expand Down

0 comments on commit 98ae3e6

Please sign in to comment.