From 7597a300f4ee9e1e1d1e6b29755037e4edc285a2 Mon Sep 17 00:00:00 2001 From: Joe Groocock Date: Mon, 11 Jun 2018 04:11:58 +0100 Subject: [PATCH] profile: Improve busybox/ash compatibility --- .profile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.profile b/.profile index 48af925..f8386b0 100644 --- a/.profile +++ b/.profile @@ -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 zsh) thisfile="$(readlink -f "${(%):-%N}")";; 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 -export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles}")" +export DOTFILES="$(dirname "${thisfile:-$XDG_CONFIG_HOME/dotfiles/.profile}")" export PATH="${PATH}:$DOTFILES/scripts" # Override paths for non-compliant programs