From 6330dce222067c22b288c22a13831144ac0e5920 Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Wed, 4 Mar 2020 12:56:45 +0100 Subject: [PATCH] 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`. --- dotfiles/.config/bash/profile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dotfiles/.config/bash/profile b/dotfiles/.config/bash/profile index 2db3b9f..5f5b6fb 100644 --- a/dotfiles/.config/bash/profile +++ b/dotfiles/.config/bash/profile @@ -25,6 +25,13 @@ export PAGER=less export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/startup.py" 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 <