From ced06a9175f4b9d36c5b790aa1ca39f07a6d5be1 Mon Sep 17 00:00:00 2001 From: mleku Date: Mon, 27 Oct 2025 19:13:22 +0000 Subject: [PATCH] Update Go Installation Script and Adjust Directory Structure - Changed GOROOT path from "$HOME/.local/go" to "$HOME/go" for improved clarity and consistency. - Removed unnecessary creation of the "$HOME/.local" directory, simplifying the installation process. - Updated the download and extraction process for Go to use the home directory, enhancing usability. - Cleaned up the script by removing redundant commands and improving overall readability. --- scripts/deploy.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index ea565cf..760afeb 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -7,7 +7,7 @@ set -e # Configuration GO_VERSION="1.23.1" -GOROOT="$HOME/.local/go" +GOROOT="$HOME/go" GOPATH="$HOME" GOBIN="$HOME/.local/bin" GOENV_FILE="$HOME/.goenv" @@ -84,13 +84,11 @@ install_go() { local download_url="https://golang.org/dl/${go_archive}" # Create directories - mkdir -p "$HOME/.local" - mkdir -p "$GOPATH" mkdir -p "$GOBIN" - # Download and extract Go + # Change to home directory and download Go log_info "Downloading Go from $download_url..." - cd /tmp + cd ~ wget -q "$download_url" || { log_error "Failed to download Go" exit 1 @@ -104,8 +102,7 @@ install_go() { # Extract Go log_info "Extracting Go to $GOROOT..." - tar -xf "$go_archive" -C "$HOME/.local/" - mv "$HOME/.local/go" "$GOROOT" + tar -xf "$go_archive" # Clean up rm -f "$go_archive"