-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Respect the XDG standard for configuration files
From GH #513: Rather than reading the user configuration from `~/.tigrc` by default, instead check `$XDG_CONFIG_HOME/tig/config` and only then look for `~/.tigrc`. Further reading: https://ploum.net/207-modify-your-application-to-use-xdg-folders/ Fixes #513
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/sh | ||
|
||
. libtest.sh | ||
|
||
tigrc <<EOF | ||
This tigrc file should not be loaded! | ||
EOF | ||
|
||
steps " | ||
<Ctrl-t> | ||
" | ||
|
||
#export TIGRC_SYSTEM="should-not-be-loaded" | ||
export XDG_CONFIG_HOME="$HOME/.config" | ||
mkdir -p "$XDG_CONFIG_HOME/tig" | ||
|
||
cat > "$XDG_CONFIG_HOME/tig/config" <<EOF | ||
bind generic <Ctrl-t> @sh -c 'echo ran > ~/RUNME' | ||
EOF | ||
|
||
test_tig status | ||
|
||
assert_equals stderr <<EOF | ||
EOF | ||
|
||
assert_equals RUNME <<EOF | ||
ran | ||
EOF |