From d9e068f3f016035b01aefa90b611196d809e7637 Mon Sep 17 00:00:00 2001 From: mitzip Date: Thu, 23 Oct 2014 14:12:18 -0500 Subject: [PATCH 1/2] Added portable sed command for OpenBSD/NetBSD Standard sed, which is used on OpenBSD and NetBSD, doesn't have the "-i" option --- tools/install.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index a53ac48ab..a6b673e1c 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -23,14 +23,14 @@ fi echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[0m" cp $ZSH/templates/zshrc.zsh-template ~/.zshrc -sed -i -e "/^ZSH=/ c\\ +sed -e "/^ZSH=/ c\\ ZSH=$ZSH -" ~/.zshrc +" ~/.zshrc | tee ~/.zshrc echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" -sed -i -e "/export PATH=/ c\\ +sed -e "/export PATH=/ c\\ export PATH=\"$PATH\" -" ~/.zshrc +" ~/.zshrc | tee ~/.zshrc if [ "$SHELL" != "$(which zsh)" ]; then echo "\033[0;34mTime to change your default shell to zsh!\033[0m" From 36acc795b9717f967e9b09dc8f14ef2a65141fe4 Mon Sep 17 00:00:00 2001 From: mitzip Date: Fri, 24 Oct 2014 12:30:07 -0500 Subject: [PATCH 2/2] Use safe temp file instead of using sed buffers https://github.com/robbyrussell/oh-my-zsh/pull/3257#issuecomment-60358947 --- tools/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index a6b673e1c..96cec4921 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -25,12 +25,14 @@ echo "\033[0;34mUsing the Oh My Zsh template file and adding it to ~/.zshrc\033[ cp $ZSH/templates/zshrc.zsh-template ~/.zshrc sed -e "/^ZSH=/ c\\ ZSH=$ZSH -" ~/.zshrc | tee ~/.zshrc +" ~/.zshrc > ~/.zshrc.omztemplate +mv -f ~/.zshrc.omztemplate ~/.zshrc echo "\033[0;34mCopying your current PATH and adding it to the end of ~/.zshrc for you.\033[0m" sed -e "/export PATH=/ c\\ export PATH=\"$PATH\" -" ~/.zshrc | tee ~/.zshrc +" ~/.zshrc > ~/.zshrc.newpath +mv -f ~/.zshrc.newpath ~/.zshrc if [ "$SHELL" != "$(which zsh)" ]; then echo "\033[0;34mTime to change your default shell to zsh!\033[0m"