Break TMPDIR setup out into it's own file

This commit is contained in:
2018-07-19 22:44:43 +01:00
parent f56aa1bffa
commit 536f89f83d
3 changed files with 10 additions and 6 deletions

View File

@@ -49,3 +49,4 @@ source "$DOTSHELL/kubernetes.sh"
# Environment Setup
source "$DOTSHELL/env.sh"
source "$DOTSHELL/tmpdir.sh"

View File

@@ -33,9 +33,3 @@ path_prepend "$HOME/bin"
# Add dotfiles' bin directory to PATH
path_prepend "$DOTBIN"
# Ensure TMPDIR is the same for local and remote ssh logins
if [[ $TMPDIR == "/var/folders/"* ]] || [[ $TMPDIR == "" ]]; then
export TMPDIR="/tmp/user-$USER"
mkdir -p "$TMPDIR"
fi

9
shell/tmpdir.sh Normal file
View File

@@ -0,0 +1,9 @@
#
# TMPDIR setup
#
# Ensure TMPDIR is the same for local and remote ssh logins
if [[ $TMPDIR == "/var/folders/"* ]] || [[ $TMPDIR == "" ]]; then
export TMPDIR="/tmp/user-$USER"
mkdir -p "$TMPDIR"
fi