X-Git-Url: https://git.sev.monster/~sev/dotfiles.git/blobdiff_plain/fef6b2b53013bce95a0b0d99a3c2c928665416b1..0b54922b0580182b7b141e9208a96f70322546a5:/base/.zprofile diff --git a/base/.zprofile b/base/.zprofile index 39abb7d..aa57163 100644 --- a/base/.zprofile +++ b/base/.zprofile @@ -1,5 +1,15 @@ -case "`uname`" in *BSD*) - mkdir -m 700 "/tmp/home-$LOGNAME" > /dev/null 2>&1 - unlink "$HOME/tmp" > /dev/null 2>&1 - ln -sFh "/tmp/home-$LOGNAME" "$HOME/tmp";; -esac +#XXX: ensure we override /etc/profile, gets loaded after .zshenv +source ~/.zshenv + +t="${TMPDIR:-/tmp}/home-$LOGNAME" +h="$HOME/tmp" +if [[ ! -e "$t" ]] { + mkdir -m 700 "$t" > /dev/null 2>&1 + #TODO: check if dir exists after mkdir +} +#allow opaque entries to override +if [[ ! -e "$h" ]] { + ln -sf "$t" "$h" > /dev/null 2>&1 +} +unset t +unset h