mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 00:00:13 -08:00
feat: Implement SKIP_OLLAMA feature for optional setup without Ollama installation and add documentation
refactor: Enhance .profile for Go path management and environment variable setup
This commit is contained in:
@@ -246,17 +246,21 @@ echo -e "${GREEN}Package installation completed for $OS_NAME $OS_VERSION.${NC}"
|
||||
# Install Go if not present (required for Fabric and other Go tools)
|
||||
echo -e "${YELLOW}Checking Go installation...${NC}"
|
||||
if ! command -v go &> /dev/null; then
|
||||
echo -e "${YELLOW}Installing Go programming language via package manager...${NC}"
|
||||
echo -e "${YELLOW}Installing Go programming language...${NC}"
|
||||
GO_VERSION="1.21.5" # Stable version that works well with Fabric
|
||||
|
||||
# Install Go via package manager (preferred approach)
|
||||
if command -v nala &> /dev/null; then
|
||||
sudo nala install -y golang-go
|
||||
else
|
||||
sudo apt update && sudo apt install -y golang-go
|
||||
fi
|
||||
# Download and install Go
|
||||
wget -q "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -O /tmp/go.tar.gz
|
||||
|
||||
echo -e "${GREEN}Go installed successfully via package manager!${NC}"
|
||||
echo -e "${YELLOW}GOROOT will be auto-detected, GOPATH configured in shell${NC}"
|
||||
# Remove any existing Go installation
|
||||
sudo rm -rf /usr/local/go
|
||||
|
||||
# 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
|
||||
echo -e "${GREEN}Go is already installed: $(go version)${NC}"
|
||||
fi
|
||||
@@ -369,7 +373,8 @@ done
|
||||
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}"
|
||||
# Setup Ollama with Docker for local AI (required for Fabric)
|
||||
echo -e "${YELLOW}Setting up Ollama with Docker for local AI support...${NC}"
|
||||
|
||||
# Check if user can run docker commands without sudo
|
||||
if docker ps >/dev/null 2>&1; then
|
||||
@@ -514,6 +519,7 @@ FABRIC_CONFIG_EOF
|
||||
if docker ps | grep -q ollama; then
|
||||
configure_fabric_for_ollama
|
||||
fi
|
||||
|
||||
fi # End SKIP_OLLAMA check
|
||||
|
||||
# Install Zsh if not already installed
|
||||
|
||||
Reference in New Issue
Block a user