Skip to content

Commit

Permalink
Optimize the installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
voidint committed Aug 4, 2020
1 parent 584bbdd commit a90a7fc
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ main() {
if [ -x "$(command -v wget)" ]; then
wget -q -P "${HOME}" "${url}"
else
curl -L -o "${dest_file}" "${url}"
curl -s -S -L -o "${dest_file}" "${url}"
fi

echo "[2/3] Install g to the ${HOME}/bin"
Expand All @@ -46,25 +46,22 @@ main() {
echo "[3/3] Set environment variables"
if [ -x "$(command -v bash)" ]; then
cat >>${HOME}/.bashrc <<-'EOF'
# ===== set g environment variables =====
export GOROOT="${HOME}/.g/go"
export PATH="${HOME}/bin:${HOME}/.g/go/bin:$PATH"
export G_MIRROR=https://golang.google.cn/dl/
EOF
# ===== set g environment variables =====
export GOROOT="${HOME}/.g/go"
export PATH="${HOME}/bin:${HOME}/.g/go/bin:$PATH"
export G_MIRROR=https://golang.google.cn/dl/
EOF
fi

if [ -x "$(command -v zsh)" ]; then
cat >>${HOME}/.zshrc <<-'EOF'
# ===== set g environment variables =====
export GOROOT="${HOME}/.g/go"
export PATH="${HOME}/bin:${HOME}/.g/go/bin:$PATH"
export G_MIRROR=https://golang.google.cn/dl/
EOF
# ===== set g environment variables =====
export GOROOT="${HOME}/.g/go"
export PATH="${HOME}/bin:${HOME}/.g/go/bin:$PATH"
export G_MIRROR=https://golang.google.cn/dl/
EOF
fi

exit 0
}

Expand Down

0 comments on commit a90a7fc

Please sign in to comment.