Skip to content

Commit

Permalink
refactor: simplified installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
voidint committed May 12, 2024
1 parent c6b1ecd commit 91c8196
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function get_os() {
echo $(uname -s | awk '{print tolower($0)}')
}

main() {
function main() {
local release="1.6.0"
local os=$(get_os)
local arch=$(get_arch)
Expand Down Expand Up @@ -61,19 +61,17 @@ export G_MIRROR=https://golang.google.cn/dl/

if [ -x "$(command -v bash)" ]; then
cat >>${HOME}/.bashrc <<-'EOF'
# g shell setup
if [ -f "${HOME}/.g/env" ]; then
. "${HOME}/.g/env"
fi
[ -s "${HOME}/.g/env" ] && \. "${HOME}/.g/env" # g shell setup
EOF
fi

if [ -x "$(command -v zsh)" ]; then
cat >>${HOME}/.zshrc <<-'EOF'
# g shell setup
if [ -f "${HOME}/.g/env" ]; then
. "${HOME}/.g/env"
fi
[ -s "${HOME}/.g/env" ] && \. "${HOME}/.g/env" # g shell setup
EOF
fi

Expand Down

0 comments on commit 91c8196

Please sign in to comment.