mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 01:10:12 -08:00
refactor: Remove Fabric installation and testing from setup scripts
This commit is contained in:
@@ -185,14 +185,6 @@ for pkg in "${pkgs[@]}"; do
|
||||
continue
|
||||
fi
|
||||
|
||||
# Handle fabric installation
|
||||
if [ "$pkg" = "fabric" ]; then
|
||||
special_installs+=("$pkg")
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Handle lazygit - available in COPR for Fedora, special install for Debian/Ubuntu
|
||||
if [ "$pkg" = "lazygit" ] && [ "$OS_NAME" != "fedora" ]; then
|
||||
special_installs+=("$pkg")
|
||||
@@ -245,28 +237,6 @@ esac
|
||||
|
||||
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...${NC}"
|
||||
GO_VERSION="1.21.5" # Stable version that works well with Fabric
|
||||
|
||||
# Download and install Go
|
||||
wget -q "https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz" -O /tmp/go.tar.gz
|
||||
|
||||
# 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
|
||||
|
||||
# Handle special installations that aren't available through package managers
|
||||
echo -e "${YELLOW}Installing special packages...${NC}"
|
||||
for pkg in "${special_installs[@]}"; do
|
||||
@@ -285,45 +255,6 @@ for pkg in "${special_installs[@]}"; do
|
||||
echo -e "${GREEN}Lazydocker is already installed${NC}"
|
||||
fi
|
||||
;;
|
||||
"fabric")
|
||||
if ! command -v fabric &> /dev/null; then
|
||||
echo -e "${YELLOW}Installing Fabric from GitHub releases...${NC}"
|
||||
# Download and install the latest Fabric binary for Linux AMD64
|
||||
curl -L https://github.com/danielmiessler/fabric/releases/latest/download/fabric-linux-amd64 -o /tmp/fabric
|
||||
chmod +x /tmp/fabric
|
||||
sudo mv /tmp/fabric /usr/local/bin/fabric
|
||||
echo -e "${GREEN}Fabric binary installed successfully!${NC}"
|
||||
|
||||
# Verify installation
|
||||
if fabric --version; then
|
||||
echo -e "${GREEN}Fabric installation verified!${NC}"
|
||||
echo -e "${YELLOW}Running Fabric setup...${NC}"
|
||||
|
||||
# Create fabric config directory
|
||||
mkdir -p "$HOME/.config/fabric"
|
||||
|
||||
# Run fabric setup with proper configuration
|
||||
echo -e "${YELLOW}Setting up Fabric patterns and configuration...${NC}"
|
||||
|
||||
# Initialize fabric with default patterns
|
||||
fabric --setup || echo -e "${YELLOW}Initial fabric setup completed${NC}"
|
||||
|
||||
# Update patterns to get the latest
|
||||
echo -e "${YELLOW}Updating Fabric patterns...${NC}"
|
||||
fabric --updatepatterns || echo -e "${YELLOW}Pattern update completed${NC}"
|
||||
|
||||
echo -e "${GREEN}Fabric setup completed successfully!${NC}"
|
||||
echo -e "${YELLOW}You can test fabric with: fabric --list-patterns${NC}"
|
||||
else
|
||||
echo -e "${RED}Fabric installation verification failed${NC}"
|
||||
fi
|
||||
else
|
||||
echo -e "${GREEN}Fabric is already installed${NC}"
|
||||
# Still try to update patterns
|
||||
echo -e "${YELLOW}Updating Fabric patterns...${NC}"
|
||||
fabric --updatepatterns || echo -e "${YELLOW}Pattern update completed${NC}"
|
||||
fi
|
||||
;;
|
||||
"lazygit")
|
||||
if ! command -v lazygit &> /dev/null; then
|
||||
echo -e "${YELLOW}Installing Lazygit from GitHub releases...${NC}"
|
||||
@@ -636,30 +567,8 @@ echo -e "${GREEN}OS: $OS_NAME $OS_VERSION${NC}"
|
||||
echo -e "${GREEN}Package Manager: $PKG_MANAGER${NC}"
|
||||
echo -e "${GREEN}Shell: $(basename "$SHELL") → zsh${NC}"
|
||||
|
||||
echo -e "\n${YELLOW}Testing Fabric installation...${NC}"
|
||||
if command -v fabric &> /dev/null; then
|
||||
echo -e "${GREEN}✓ Fabric is installed${NC}"
|
||||
|
||||
# Test fabric patterns
|
||||
echo -e "${YELLOW}Testing Fabric patterns...${NC}"
|
||||
if fabric --list-patterns >/dev/null 2>&1; then
|
||||
echo -e "${GREEN}✓ Fabric patterns are available${NC}"
|
||||
echo -e "${YELLOW}Number of patterns: $(fabric --list-patterns 2>/dev/null | wc -l)${NC}"
|
||||
else
|
||||
echo -e "${YELLOW}⚠ Fabric patterns may need to be updated${NC}"
|
||||
fi
|
||||
else
|
||||
echo -e "${RED}✗ Fabric is not installed${NC}"
|
||||
fi
|
||||
|
||||
echo -e "\n${GREEN}=== Post-Installation Instructions ===${NC}"
|
||||
echo -e "${YELLOW}1. Restart your shell or run: source ~/.zshrc${NC}"
|
||||
echo -e "${YELLOW}2. Test Fabric: fabric --list-patterns${NC}"
|
||||
echo -e "${YELLOW}3. Try a Fabric pattern: echo 'Hello world' | fabric --pattern summarize${NC}"
|
||||
|
||||
echo -e "\n${GREEN}=== Useful Commands ===${NC}"
|
||||
echo -e "${YELLOW}• Fabric help: fabric --help${NC}"
|
||||
echo -e "${YELLOW}• Update patterns: fabric --updatepatterns${NC}"
|
||||
|
||||
echo -e "\n${GREEN}Setup completed successfully for $OS_NAME $OS_VERSION!${NC}"
|
||||
echo -e "${YELLOW}Note: You may need to log out and log back in for all changes to take effect.${NC}"
|
||||
|
||||
Reference in New Issue
Block a user