diff --git a/.my_zshrc b/.my_zshrc index 4dea046..e24b6e3 100644 --- a/.my_zshrc +++ b/.my_zshrc @@ -1,12 +1,17 @@ # Python and virtual env PYTHONPYCACHEPREFIX=$HOME/.cache/python -which virtualenvwrapper.sh >/dev/null -if [ "$?" != "1" ]; then - export VIRTUALENVWRAPPER_PYTHON=$(which python3) - export VIRTUALENVWRAPPER_VIRTUALENV=$(which virtualenv) - export WORKON_HOME=~/.virtualenvs - . $(which virtualenvwrapper.sh) + +# Try to find virtualenvwrapper.sh and fail silently if not found +VIRTUAL_ENV_WRAPPER_PATH=$(command -v virtualenvwrapper.sh 2>/dev/null) + +if [ -n "$VIRTUAL_ENV_WRAPPER_PATH" ]; then + # Set up the environment variables and source the script + export VIRTUALENVWRAPPER_PYTHON=$(command -v python3) + export VIRTUALENVWRAPPER_VIRTUALENV=$(command -v virtualenv) + export WORKON_HOME="$HOME/.virtualenvs" + source "$VIRTUAL_ENV_WRAPPER_PATH" fi + # Turn on better_exceptions in python # https://github.com/Qix-/better-exceptions export BETTER_EXCEPTIONS=1 diff --git a/setup.sh b/setup.sh index 15c6dcd..0ec4ea9 100755 --- a/setup.sh +++ b/setup.sh @@ -9,7 +9,7 @@ set -e touch ~/.bash_sessions_disable cd ~ -for file in .vimrc .vim .selected_editor .profile .hushlogin .jshintrc .gitconfig .zshrc; do +for file in .vimrc .vim .selected_editor .hushlogin .jshintrc .gitconfig; do if [ -h $file ]; then # File is already a symbolic link echo "Symlink for $file is already there" @@ -24,6 +24,9 @@ for file in .vimrc .vim .selected_editor .profile .hushlogin .jshintrc .gitconfi ln -s homedir/$file done +echo Installing shell +curl -fsSL https://raw.githubusercontent.com/gustavohellwig/gh-zsh/main/gh-zsh.sh | bash + set +e function checkExe() {