f85087005a966445e167bf7962f35032597663c3

Author
Marc Cornellà <hello@mcornella.com>
Committer
Marc Cornellà <hello@mcornella.com>
Date

Message

fix(installer): fix POSIX shell syntax of previous commit

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index d210d8cc97d63eb998c21a3f6578c7aa01c80b3d..731d89a2997a23669b72d0c0fa11174117a6f59e 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -250,9 +250,9 @@ setup_zshrc() {
 6 
 7   echo "${GREEN}Using the Oh My Zsh template file and adding it to ~/.zshrc.${RESET}"
 8 
 9-  sed "/^export ZSH=/ c\\
10-export ZSH=\"${ZSH/$HOME\//\$HOME\/}\"
11-" "$ZSH/templates/zshrc.zsh-template" > ~/.zshrc-omztemp
12+  # Replace $HOME path with '$HOME' in $ZSH variable in .zshrc file
13+  omz=$(echo "$ZSH" | sed "s|^$HOME/|\$HOME/|")
14+  sed "s|^export ZSH=.*$|export ZSH=\"${omz}\"|" "$ZSH/templates/zshrc.zsh-template" > ~/.zshrc-omztemp
15   mv -f ~/.zshrc-omztemp ~/.zshrc
16 
17   echo