From 48151a36ec503d85528eb5a42858c1850b3ba8d4 Mon Sep 17 00:00:00 2001 From: david Date: Sun, 13 May 2018 22:05:55 +0200 Subject: [PATCH] sync --- setup_zsh.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/setup_zsh.sh b/setup_zsh.sh index 604c666..fc3460b 100644 --- a/setup_zsh.sh +++ b/setup_zsh.sh @@ -12,9 +12,13 @@ command="$0" root="$HOME/.dotfiles" plugins="$root/zsh" timestamp=$(date +"%Y%m%d%H%M") -repo="https://socialg.it/david/dotfiles.git" -dependencies="awk tee ls git wget curl rm mv sleep date" debug=1 +dependencies="awk tee ls git wget curl rm mv sleep date" +if [ $(uname) == "Darwin" ]; then + alias sed="gsed" + #TODO: check if gsed is there first +fi + # **** functions **** message() { @@ -97,7 +101,7 @@ curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh message i "oh-my-zsh installed" # set $ZSH_THEME="" in .zshrc -cat $HOME/.zshrc | sed "s/^ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"\"/g" > $HOME/.zshrc +sed -i "s/^ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"\"/g" $HOME/.zshrc message i "oh-my-zsh theme deactivated" # clone plugins @@ -114,7 +118,8 @@ message i "all plugins cloned" # set $plugins in .zshrc plugins="git zsh-autosuggestions autoupdate sysadmin-util zsh-syntax-highlighting zsh-david async pure" -cat $HOME/.zshrc | sed "/plugins=(/,/)/d; s/source \$ZSH\/oh-my-zsh.sh/plugins=($plugins);; source \$ZSH\/oh-my-zsh.sh/g" | sed $'s/;; /\\\n/g' > $HOME/.zshrc +sed -i "/plugins=(/,/)/d; s/source \$ZSH\/oh-my-zsh.sh/plugins=($plugins);; source \$ZSH\/oh-my-zsh.sh/g" $HOME/.zshrc +sed -i $'s/;; /\\\n/g' $HOME/.zshrc message i "activated zsh plugins [$plugins]" message d "Installer finished."