From 4866703513c2ffc972f02be5d74edf2e2d5cdb45 Mon Sep 17 00:00:00 2001 From: Joe Ipson Date: Wed, 31 Jan 2024 22:57:47 -0700 Subject: [PATCH] zshrc fix --- config/files/usr/etc/skel/.zshrc | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/config/files/usr/etc/skel/.zshrc b/config/files/usr/etc/skel/.zshrc index feae3a3..d438775 100644 --- a/config/files/usr/etc/skel/.zshrc +++ b/config/files/usr/etc/skel/.zshrc @@ -7,20 +7,20 @@ if [ -n "$CONTAINER_ID" ]; then SETUP_DONE="$XDG_CONFIG_HOME/setup-done" if ! [ -f "$SETUP_DONE" ]; then - echo 'Running initial setup...' + if [ -n "$SETUP_DEV_TOOLS" ]; then + echo 'Running initial setup...' - # Install oh-my-zsh - git clone https://github.com/ohmyzsh/ohmyzsh.git "$XDG_CONFIG_HOME/oh-my-zsh" - cp $XDG_CONFIG_HOME/oh-my-zsh/templates/zshrc.zsh-template "$XDG_CONFIG_HOME/.zshrc" - sed -i 's/export ZSH=\$HOME\/.oh-my-zsh/export ZSH=\$XDG_CONFIG_HOME\/oh-my-zsh/' "$XDG_CONFIG_HOME/.zshrc" + # Install oh-my-zsh + git clone https://github.com/ohmyzsh/ohmyzsh.git "$XDG_CONFIG_HOME/oh-my-zsh" + cp $XDG_CONFIG_HOME/oh-my-zsh/templates/zshrc.zsh-template "$XDG_CONFIG_HOME/.zshrc" + sed -i 's/export ZSH=\$HOME\/.oh-my-zsh/export ZSH=\$XDG_CONFIG_HOME\/oh-my-zsh/' "$XDG_CONFIG_HOME/.zshrc" - # Spaceship theme - ZSH_CUSTOM="$XDG_CONFIG_HOME/oh-my-zsh/custom" - git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1 - ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" - sed -i 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="spaceship"/' "$XDG_CONFIG_HOME/.zshrc" + # Spaceship theme + ZSH_CUSTOM="$XDG_CONFIG_HOME/oh-my-zsh/custom" + git clone https://github.com/denysdovhan/spaceship-prompt.git "$ZSH_CUSTOM/themes/spaceship-prompt" --depth=1 + ln -s "$ZSH_CUSTOM/themes/spaceship-prompt/spaceship.zsh-theme" "$ZSH_CUSTOM/themes/spaceship.zsh-theme" + sed -i 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="spaceship"/' "$XDG_CONFIG_HOME/.zshrc" - if [ -n "$SETUP_DEV_TOOLS" ]; then # nvm nvm_setup='[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' @@ -45,14 +45,16 @@ if [ -n "$CONTAINER_ID" ]; then "$PYENV_ROOT/bin/pyenv" install 3.10.13; "$PYENV_ROOT/bin/pyenv" install 2.7.18 "$PYENV_ROOT/bin/pyenv" virtualenv 2.7.18 local2 "$PYENV_ROOT/bin/pyenv" global 3.10.13 local2 - fi - echo 1 > "$SETUP_DONE" + echo 1 > "$SETUP_DONE" + fi fi - - source "$XDG_CONFIG_HOME/.zshrc" unset SETUP_DONE + if [ -f "$XDG_CONFIG_HOME/.zshrc" ]; then + source "$XDG_CONFIG_HOME/.zshrc" + fi + db_glob_pattern="$XDG_CONFIG_HOME/config.d/*.zsh" if stat -t "$db_glob_pattern" >/dev/null 2>&1; then