1
0
mirror of https://github.com/frebib/dotfiles.git synced 2024-06-14 12:57:23 +00:00

profile: Improve busybox/ash compatibility

This commit is contained in:
Joe Groocock 2018-06-11 04:11:58 +01:00 committed by GitHub
parent f1a353aed5
commit 7597a300f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,9 +12,9 @@ mkdir -p "$XDG_CONFIG_HOME" "$XDG_CACHE_HOME" "$XDG_DATA_HOME" "$XDG_LOCAL_HOME"
case "$(basename "$(readlink -f /proc/$$/exe)")" in case "$(basename "$(readlink -f /proc/$$/exe)")" in
zsh) thisfile="$(readlink -f "${(%):-%N}")";; zsh) thisfile="$(readlink -f "${(%):-%N}")";;
bash) thisfile="$(readlink -f "${BASH_SOURCE[0]}")";; bash) thisfile="$(readlink -f "${BASH_SOURCE[0]}")";;
*) thisfile="$(find /proc/$$/fd/ | xargs readlink -f | grep .profile | head -n1)";; *) thisfile="$(find /proc/$$/fd/ | xargs -n1 -r readlink -f | grep profile | head -n1)";;
esac esac
export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles}")" export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles/.profile}")"
export PATH="${PATH}:$DOTFILES/scripts" export PATH="${PATH}:$DOTFILES/scripts"
# Override paths for non-compliant programs # Override paths for non-compliant programs