diff options
| author | danix <danix@danix.xyz> | 2023-04-10 18:15:36 +0200 |
|---|---|---|
| committer | danix <danix@danix.xyz> | 2023-04-10 18:15:36 +0200 |
| commit | 6a1930959e1cb0ec8739254bedc6b8de2bcc20fd (patch) | |
| tree | f674b2102b038eaeec30a03da45ff965ede540e2 /SOURCE/CORE/core-add.sh | |
| parent | f1343f207a71b79c69474bd0205fa09b46a6a876 (diff) | |
| download | bash-notes-6a1930959e1cb0ec8739254bedc6b8de2bcc20fd.tar.gz bash-notes-6a1930959e1cb0ec8739254bedc6b8de2bcc20fd.zip | |
when creating a note, if the title is not specified, two random words will be assigned as title.
Diffstat (limited to 'SOURCE/CORE/core-add.sh')
| -rw-r--r-- | SOURCE/CORE/core-add.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/SOURCE/CORE/core-add.sh b/SOURCE/CORE/core-add.sh index aa9d451..ed6256c 100644 --- a/SOURCE/CORE/core-add.sh +++ b/SOURCE/CORE/core-add.sh @@ -4,7 +4,8 @@ function addnote() { rm $TMPDB fi - NOTETITLE="$1" + RTITLE=$(random_title) + [[ -z "$1" ]] && NOTETITLE="$RTITLE" || NOTETITLE="$1" echo "adding new note - \"$NOTETITLE\"" # shellcheck disable=SC2086 LASTID=$($JQ '.notes[-1].id // 0 | tonumber' $DB) |
