-
-
Notifications
You must be signed in to change notification settings - Fork 244
Use XDG_CONFIG_HOME if available #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 5 commits
44166c5
e29aa7b
386a30c
79b4b8c
9686f24
e22285b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -438,10 +438,18 @@ _option_value_is_present() { | |
|
|
||
| # $NBRC_PATH | ||
| # | ||
| # Default: `$HOME/.nbrc` | ||
| # | ||
| # The location of the .nbrc configuration file. | ||
| export NBRC_PATH="${NBRC_PATH:-"${HOME}/.${_ME}rc"}" | ||
| # Default: `$HOME/.nbrc`, or `$XDG_CONFIG_HOME/nb/config` if `XDG_CONFIG_HOME` | ||
| # is defined and `$HOME/.nbrc` does not already exist | ||
| # | ||
| # Check if XDG_CONFIG_HOME exists | ||
| if [[ -n "${XDG_CONFIG_HOME}" ]]; then | ||
| # If XDG_CONFIG_HOME exists put .nbrc config file in a subdirectory. | ||
| mkdir -p "${XDG_CONFIG_HOME}/${_ME%%.*}" && | ||
|
||
| export NBRC_PATH="${NBRC_PATH:-"${XDG_CONFIG_HOME}/${_ME%%.*}/${_ME}rc"}" | ||
| else | ||
| # Otherwise, use the default path | ||
| export NBRC_PATH="${NBRC_PATH:-"${HOME}/.${_ME}rc"}" | ||
|
||
| fi | ||
MrDowntempo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| # Handle symlinked NBRC_PATH. | ||
| if [[ -L "${NBRC_PATH}" ]] | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, I think this would always use
XDG_CONFIG_HOME/nb/.nbrcifXDG_CONFIG_HOMEis defined. It should probably still default to using$HOME/.nbrcif the file already exists so it doesn't break existing installations and setups.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think you're right. I hadn't considered that.