Make sure $XDG_CACHE_HOME/bash exists

`bash` will not save history if this directory doesn't exist - it will
create the file but not the directories in the path.

Just to be safe, we do the same for `less`.
This commit is contained in:
Fernando Schauenburg 2020-03-04 12:56:45 +01:00
parent 2e4bb9e376
commit 6330dce222

View file

@ -25,6 +25,13 @@ export PAGER=less
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py" export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py"
export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC' export VIMINIT='let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc" | source $MYVIMRC'
# Ensure cache directories exist so programs can write history.
while read -r dir; do [ -d "$dir" ] || mkdir -p -- "$dir"; done <<EOL
$XDG_CACHE_HOME/bash
$XDG_CACHE_HOME/less
EOL
unset dir
############################################################################## ##############################################################################
# Customize PATH (and MANPATH) # Customize PATH (and MANPATH)
############################################################################## ##############################################################################
@ -354,7 +361,7 @@ colortest() {
} }
############################################################################## ##############################################################################
# Run external cusomizations # Run external customizations
############################################################################## ##############################################################################
stty -ixon # disable ctrl-s and ctrl-q stty -ixon # disable ctrl-s and ctrl-q