From 80b6573ecd1e74e20d174ebd0a9e0f640ec1e580 Mon Sep 17 00:00:00 2001 From: William Melody Date: Sun, 25 Oct 2020 09:20:30 -0700 Subject: [PATCH 1/2] Improve variable name in _add(). --- nb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/nb b/nb index 80b4f6b5b..a7e6ada93 100755 --- a/nb +++ b/nb @@ -2920,7 +2920,7 @@ _add() { local _edit_before_commit=0 local _encrypt=0 local _file_type="${NB_DEFAULT_EXTENSION}" - local _maybe_content_or_filename= + local _content_or_filename= local _password= local _target_filename= local _title= @@ -2966,9 +2966,9 @@ _add() { shift ;; *) - if [[ -z "${_maybe_content_or_filename:-}" ]] + if [[ -z "${_content_or_filename:-}" ]] then - _maybe_content_or_filename="${__arg:-}" + _content_or_filename="${__arg:-}" else _arguments+=("${__arg:-}") fi @@ -2985,21 +2985,21 @@ _add() { store tech top tk tv uk us vip wang website work xyz ) - local _maybe_content_or_filename_extension="${_maybe_content_or_filename##*\.}" + local _content_or_filename_extension="${_content_or_filename##*\.}" - if [[ -n "${_maybe_content_or_filename:-}" ]] + if [[ -n "${_content_or_filename:-}" ]] then - if [[ "${_maybe_content_or_filename:-}" =~ \.[A-Za-z0-9]+$ ]] && - [[ -n "${_maybe_content_or_filename_extension:-}" ]] && + if [[ "${_content_or_filename:-}" =~ \.[A-Za-z0-9]+$ ]] && + [[ -n "${_content_or_filename_extension:-}" ]] && [[ -z "${_target_filename}" ]] && - ! _string_is_url "${_maybe_content_or_filename:-}" && - ! _string_is_email "${_maybe_content_or_filename:-}" && - ! _contains "${_maybe_content_or_filename_extension:-}" \ + ! _string_is_url "${_content_or_filename:-}" && + ! _string_is_email "${_content_or_filename:-}" && + ! _contains "${_content_or_filename_extension:-}" \ "${_common_non_text_file_extension_tlds[@]}" then - _target_filename="${_maybe_content_or_filename}" + _target_filename="${_content_or_filename}" else - _content="${_maybe_content_or_filename}" + _content="${_content_or_filename}" fi fi From fae36484fdf11e087d12fab8bc31c47062673273 Mon Sep 17 00:00:00 2001 From: William Melody Date: Sun, 25 Oct 2020 09:37:13 -0700 Subject: [PATCH 2/2] Update version to 5.7.8 --- nb | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nb b/nb index a7e6ada93..8a1e96481 100755 --- a/nb +++ b/nb @@ -68,7 +68,7 @@ IFS=$'\n\t' # $_VERSION # # The most recent program version. -_VERSION="5.7.7" +_VERSION="5.7.8" # $_ME # diff --git a/package-lock.json b/package-lock.json index 3061fafee..e3f223b89 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { "name": "nb.sh", - "version": "5.7.7", + "version": "5.7.8", "lockfileVersion": 1 } diff --git a/package.json b/package.json index 5d3ebcdbe..25eb65487 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nb.sh", - "version": "5.7.7", + "version": "5.7.8", "description": "CLI note-taking, bookmarking, and archiving with encryption, search, Git-backed versioning and syncing, tagging, and more in a single portable script.", "global": true, "install": "make install",