mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 01:10:12 -08:00
feat: Update Go installation method to use package manager and adjust environment variables
This commit is contained in:
@@ -129,9 +129,9 @@ if [ -f "$HOME/shell/completions/backup-scripts-completion.bash" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Go environment variables (required for Fabric and other Go tools)
|
# Go environment variables (required for Fabric and other Go tools)
|
||||||
export GOROOT=/usr/local/go
|
# GOROOT is auto-detected by Go when installed via package manager
|
||||||
export GOPATH=$HOME/go
|
export GOPATH=$HOME/go
|
||||||
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
|
export PATH=$GOPATH/bin:$PATH
|
||||||
|
|
||||||
# Fabric AI - Pattern aliases and helper functions
|
# Fabric AI - Pattern aliases and helper functions
|
||||||
if command -v fabric &> /dev/null; then
|
if command -v fabric &> /dev/null; then
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
// Core tools
|
// Core tools
|
||||||
git
|
git
|
||||||
|
golang-go
|
||||||
python3
|
python3
|
||||||
wget
|
wget
|
||||||
curl
|
curl
|
||||||
|
|||||||
@@ -246,21 +246,17 @@ echo -e "${GREEN}Package installation completed for $OS_NAME $OS_VERSION.${NC}"
|
|||||||
# Install Go if not present (required for Fabric and other Go tools)
|
# Install Go if not present (required for Fabric and other Go tools)
|
||||||
echo -e "${YELLOW}Checking Go installation...${NC}"
|
echo -e "${YELLOW}Checking Go installation...${NC}"
|
||||||
if ! command -v go &> /dev/null; then
|
if ! command -v go &> /dev/null; then
|
||||||
echo -e "${YELLOW}Installing Go programming language...${NC}"
|
echo -e "${YELLOW}Installing Go programming language via package manager...${NC}"
|
||||||
GO_VERSION="1.21.5" # Stable version that works well with Fabric
|
|
||||||
|
|
||||||
# Download and install Go
|
# Install Go via package manager (preferred approach)
|
||||||
wget -q "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -O /tmp/go.tar.gz
|
if command -v nala &> /dev/null; then
|
||||||
|
sudo nala install -y golang-go
|
||||||
|
else
|
||||||
|
sudo apt update && sudo apt install -y golang-go
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove any existing Go installation
|
echo -e "${GREEN}Go installed successfully via package manager!${NC}"
|
||||||
sudo rm -rf /usr/local/go
|
echo -e "${YELLOW}GOROOT will be auto-detected, GOPATH configured in shell${NC}"
|
||||||
|
|
||||||
# Extract Go to /usr/local
|
|
||||||
sudo tar -C /usr/local -xzf /tmp/go.tar.gz
|
|
||||||
rm /tmp/go.tar.gz
|
|
||||||
|
|
||||||
echo -e "${GREEN}Go ${GO_VERSION} installed successfully!${NC}"
|
|
||||||
echo -e "${YELLOW}Go PATH will be configured in shell configuration${NC}"
|
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}Go is already installed: $(go version)${NC}"
|
echo -e "${GREEN}Go is already installed: $(go version)${NC}"
|
||||||
fi
|
fi
|
||||||
@@ -370,7 +366,10 @@ FABRIC_EOF
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Setup Ollama with Docker for local AI (required for Fabric)
|
# Setup Ollama with Docker for local AI (required for Fabric)
|
||||||
echo -e "${YELLOW}Setting up Ollama with Docker for local AI support...${NC}"
|
if [ "${SKIP_OLLAMA:-false}" = "true" ]; then
|
||||||
|
echo -e "${YELLOW}Skipping Ollama installation (SKIP_OLLAMA=true)${NC}"
|
||||||
|
else
|
||||||
|
echo -e "${YELLOW}Setting up Ollama with Docker for local AI support...${NC}"
|
||||||
|
|
||||||
# Check if user can run docker commands without sudo
|
# Check if user can run docker commands without sudo
|
||||||
if docker ps >/dev/null 2>&1; then
|
if docker ps >/dev/null 2>&1; then
|
||||||
@@ -515,6 +514,7 @@ FABRIC_CONFIG_EOF
|
|||||||
if docker ps | grep -q ollama; then
|
if docker ps | grep -q ollama; then
|
||||||
configure_fabric_for_ollama
|
configure_fabric_for_ollama
|
||||||
fi
|
fi
|
||||||
|
fi # End SKIP_OLLAMA check
|
||||||
|
|
||||||
# Install Zsh if not already installed
|
# Install Zsh if not already installed
|
||||||
echo -e "${YELLOW}Installing Zsh...${NC}"
|
echo -e "${YELLOW}Installing Zsh...${NC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user