Skip to content

Commit

Permalink
(2.0.5) Fixed date resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
novusnota committed Apr 19, 2021
1 parent ce09234 commit 7d76f70
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
3 changes: 3 additions & 0 deletions config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ export C_NOTES_FORMAT="md"
# (optional) A /path/to/template file for the new notes
export C_NOTES_TEMPLATE="template"

# (CHANGE ONLY IF YOU KNOW, WHAT YOU'RE DOING) Export args, if any
test "${#}" -ne 0 && export "${@}"

21 changes: 19 additions & 2 deletions notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# # # "#m#" "mm "#mm" "mmm" # "mmm" # #
#
# See: https://github.com/novusnota/notes.sh
# Version: 2.0.4
# Version: 2.0.5
#
# Create a dated text file at a specific location and append text to it.
#
Expand Down Expand Up @@ -180,6 +180,21 @@ getNotesSubEntity() {
local divider="$5"
local result=""

if [ "${divider}" = "_" ]; then

if [ "${mSubdir}" != "true" ]; then
result="${mText}${divider}${result}"
fi

if [ "${ySubdir}" != "true" ]; then
result="${yText}${divider}${result}"
fi

echo "$result"

return 0
fi

if [ "${mSubdir}" = "true" ]; then
result="${mText}${divider}${result}"
fi
Expand All @@ -197,6 +212,8 @@ getNotesSubEntity() {
echo "$result"
}

# separated function for the files (because they should decrease)

######
#####################
### CONFIGURATION ###
Expand Down Expand Up @@ -259,7 +276,7 @@ fi
# Fetching day number, month number and a year number
##

mapfile -t C_NOTES_DATE < <(date '+%Y %m %d')
readonly C_NOTES_DATE=($(date '+%Y %m %d'))
readonly C_NOTES_Y="${C_NOTES_DATE[0]}"
readonly C_NOTES_M="${C_NOTES_DATE[1]}"
readonly C_NOTES_D="${C_NOTES_DATE[2]}"
Expand Down

0 comments on commit 7d76f70

Please sign in to comment.