mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
fix bug where $XDG_DATA_HOME is not set properly when switching between users via su
This commit is contained in:
parent
cdc171b272
commit
a7c9575bce
@ -47,8 +47,8 @@ EOF
|
||||
complete -o default -o bashdefault -F _autojump_files cp mv meld diff kdiff3 vim emacs
|
||||
|
||||
#determine the data directory according to the XDG Base Directory Specification
|
||||
if [ -n "$XDG_DATA_HOME" ]; then
|
||||
export AUTOJUMP_DATA_DIR="$XDG_DATA_HOME/autojump"
|
||||
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} =~ ${USER} ]]; then
|
||||
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
|
||||
else
|
||||
export AUTOJUMP_DATA_DIR=~/.local/share/autojump
|
||||
fi
|
||||
|
@ -15,7 +15,7 @@
|
||||
#along with autojump. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# determine the data directory according to the XDG Base Directory Specification
|
||||
if [[ -n ${XDG_DATA_HOME} ]]; then
|
||||
if [[ -n ${XDG_DATA_HOME} ]] && [[ ${XDG_DATA_HOME} =~ ${USER} ]]; then
|
||||
export AUTOJUMP_DATA_DIR="${XDG_DATA_HOME}/autojump"
|
||||
else
|
||||
export AUTOJUMP_DATA_DIR=${HOME}/.local/share/autojump
|
||||
|
Loading…
Reference in New Issue
Block a user