b3f167d998580d4017a16c23c233925a5cb7afb0

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #3613 from apjanke/remove-sed-i

Installer: Remove "sed -i" for portability and hygiene

Diff

 1diff --git a/tools/install.sh b/tools/install.sh
 2index c83a6f23d0776abec9a189f90d0846d8d3036ab0..17f4076c1d542e08b35fa04c85023c8961a16d5d 100755
 3--- a/tools/install.sh
 4+++ b/tools/install.sh
 5@@ -23,14 +23,16 @@ fi
 6 
 7 echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m"
 8 cp $ZSH/templates/zshrc.zsh-template ~/.zshrc
 9-sed -i -e "/^export ZSH=/ c\\
10+sed "/^export ZSH=/ c\\
11 export ZSH=$ZSH
12-" ~/.zshrc
13+" ~/.zshrc > ~/.zshrc-omztemp
14+mv -f ~/.zshrc-omztemp ~/.zshrc
15 
16 echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m"
17-sed -i -e "/export PATH=/ c\\
18+sed "/export PATH=/ c\\
19 export PATH=\"$PATH\"
20-" ~/.zshrc
21+" ~/.zshrc > ~/.zshrc-omztemp
22+mv -f ~/.zshrc-omztemp ~/.zshrc
23 
24 TEST_CURRENT_SHELL=$(expr "$SHELL" : '.*/\(.*\)')
25 if [ "$TEST_CURRENT_SHELL" != "zsh" ]; then