Skip to content

Commit

Permalink
优化goupdate命令
Browse files Browse the repository at this point in the history
  • Loading branch information
Jrohy committed Mar 16, 2022
1 parent f08963e commit e2d9382
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,19 @@ installGo(){
}

installUpdater(){
if [[ $OS == "Linux" && ! -e /usr/local/bin/goupdate ]];then
echo "source <(curl -L https://go-install.netlify.app/install.sh)" > /usr/local/bin/goupdate
chmod +x /usr/local/bin/goupdate
elif [[ $OS == "Darwin" && ! -e $HOME/go/bin/goupdate ]];then
cat > $HOME/go/bin/goupdate << EOF
if [[ $OS == "Linux" ]];then
if [[ ! -e /usr/local/bin/goupdate || -z `cat /usr/local/bin/goupdate|grep '$@'` ]];then
echo 'source <(curl -L https://go-install.netlify.app/install.sh) $@' > /usr/local/bin/goupdate
chmod +x /usr/local/bin/goupdate
fi
elif [[ $OS == "Darwin" ]];then
if [[ ! -e $HOME/go/bin/goupdate || -z `cat $HOME/go/bin/goupdate|grep '$@'` ]];then
cat > $HOME/go/bin/goupdate << 'EOF'
#!/bin/zsh
source <(curl -L https://go-install.netlify.app/install.sh)
source <(curl -L https://go-install.netlify.app/install.sh) $@
EOF
chmod +x $HOME/go/bin/goupdate
chmod +x $HOME/go/bin/goupdate
fi
fi
}

Expand Down

0 comments on commit e2d9382

Please sign in to comment.