Skip to content

Commit

Permalink
Fix noterc path when XDG_CONFIG_HOME is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
dcchambers committed Jul 28, 2020
1 parent a3e7bce commit 449c6c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# CHANGELOG

## v0.4.1 - 28 July 2020

## v0.4.0 - 28 July 2020

* Added config file (noterc)
Expand Down
6 changes: 3 additions & 3 deletions note
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DAY=$(date +'%d')
NOTE_DIR="$HOME/notes/$YEAR/$MONTH"
NOTE_NAME="$DAY.md"

NOTERC="${XDG_CONFIG_HOME:-$HOME}/notekeeper/noterc"
NOTERC="${XDG_CONFIG_HOME:-$HOME/.config}/notekeeper/noterc"
if [ -f "$NOTERC" ]; then source "$NOTERC"; fi

create_note() {
Expand All @@ -32,7 +32,7 @@ print_info() {
}

print_help() {
printf "note - Note Keeper 0.4.0 (28 July 2020)
printf "note - Note Keeper 0.4.1 (28 July 2020)
Usage: note [arguments]
Expand All @@ -45,7 +45,7 @@ Arguments:
Don't forget an extension like .md
-i | --info Print information about a note.
The script loads configuration variables from \${XDG_CONFIG_HOME:-\$HOME}/notekeeper/noterc.
The script loads configuration variables from \${XDG_CONFIG_HOME:-\$HOME/.config}/notekeeper/noterc.
Example:
# Directory where the current note should be stored
Expand Down

0 comments on commit 449c6c0

Please sign in to comment.