sh: Fix missing python configuration

Python complains if you point it to a different configuration file (as
we do with the changes to XDG directories) but it doesn't exist. So, we
simply check for its existence and create it if necessary when setting
up an environment.
This commit is contained in:
Marty Oehme 2022-12-08 21:34:40 +01:00
parent aefce1c498
commit c6f243c2c1
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9

View file

@ -84,6 +84,10 @@ export LESSHISTFILE="XDG_STATE_HOME/lesshst"
export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer" export MPLAYER_HOME="$XDG_CONFIG_HOME/mplayer"
export NODE_REPL_HISTORY="$XDG_STATE_HOME/node_repl_history" export NODE_REPL_HISTORY="$XDG_STATE_HOME/node_repl_history"
export NVM_DIR="$XDG_DATA_HOME/nvm" export NVM_DIR="$XDG_DATA_HOME/nvm"
if [ ! -e "$PYTHONSTARTUP" ]; then
mkdir -p "$XDG_CONFIG_HOME/python"
touch "$PYTHONSTARTUP"
fi
export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc" export PYTHONSTARTUP="$XDG_CONFIG_HOME/python/pythonrc"
export SQLITE_HISTORY="$XDG_STATE_HOME/sqlite_history" export SQLITE_HISTORY="$XDG_STATE_HOME/sqlite_history"
export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var" export TEXMFVAR="$XDG_CACHE_HOME/texlive/texmf-var"