mirror of
https://github.com/theniceboy/.config.git
synced 2026-07-16 22:01:21 +08:00
install packages in upgrade all script
This commit is contained in:
parent
53919d869a
commit
b2a093db98
2 changed files with 77 additions and 97 deletions
|
|
@ -122,9 +122,76 @@ class ParallelTaskRunner:
|
||||||
print(f"\n{Colors.RED}Total failed: {len(failed_tasks)} out of {len(all_results)} tasks{Colors.RESET}")
|
print(f"\n{Colors.RED}Total failed: {len(failed_tasks)} out of {len(all_results)} tasks{Colors.RESET}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def install_brew_packages():
|
||||||
|
"""Install missing brew packages."""
|
||||||
|
print("📦 Checking brew packages...")
|
||||||
|
|
||||||
|
# Get list of installed packages
|
||||||
|
try:
|
||||||
|
result = subprocess.run(['brew', 'list', '--formula', '-1'],
|
||||||
|
capture_output=True, text=True, check=True)
|
||||||
|
installed_packages = result.stdout.strip()
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
print("❌ Failed to get brew package list")
|
||||||
|
return False
|
||||||
|
|
||||||
|
packages = [
|
||||||
|
# System utilities
|
||||||
|
"htop", "dust", "ncdu", "fswatch", "pipx", "uv",
|
||||||
|
# macOS GNU utilities
|
||||||
|
"coreutils", "gnu-tar", "gnu-getopt", "gnu-sed",
|
||||||
|
# Development tools
|
||||||
|
"node", "go", "gcc", "gdb", "automake", "cmake", "jsdoc3", "oven-sh/bun/bun",
|
||||||
|
# Text processing and search
|
||||||
|
"ripgrep", "the_silver_searcher", "fd", "fzf", "bat", "ccat", "tree", "jq",
|
||||||
|
# File management
|
||||||
|
"yazi", "sevenzip",
|
||||||
|
# Git and version control
|
||||||
|
"git", "git-delta", "git-flow", "jesseduffield/lazygit/lazygit", "gh",
|
||||||
|
# Media and graphics
|
||||||
|
"ffmpeg", "imagemagick", "poppler", "yt-dlp",
|
||||||
|
# Network and web
|
||||||
|
"wget", "speedtest-cli",
|
||||||
|
# Terminal and shell
|
||||||
|
"tmux", "neovim", "starship", "rainbarf", "neofetch", "onefetch", "tldr", "bmon", "loc",
|
||||||
|
# Applications
|
||||||
|
"awscli", "azure-cli", "terraform"
|
||||||
|
]
|
||||||
|
|
||||||
|
missing_packages = []
|
||||||
|
installed_list = installed_packages.split('\n')
|
||||||
|
|
||||||
|
for package in packages:
|
||||||
|
# Handle tap packages (contains /)
|
||||||
|
if "/" in package:
|
||||||
|
package_name = package.split("/")[-1] # Extract package name after last /
|
||||||
|
if package_name not in installed_list:
|
||||||
|
missing_packages.append(package)
|
||||||
|
else:
|
||||||
|
if package not in installed_list:
|
||||||
|
missing_packages.append(package)
|
||||||
|
|
||||||
|
if missing_packages:
|
||||||
|
print(f"Installing {len(missing_packages)} missing packages...")
|
||||||
|
for package in missing_packages:
|
||||||
|
try:
|
||||||
|
subprocess.run(['brew', 'install', package], check=True)
|
||||||
|
print(f"✅ Installed {package}")
|
||||||
|
except subprocess.CalledProcessError:
|
||||||
|
print(f"❌ Failed to install {package}")
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print("✅ All packages already installed")
|
||||||
|
return True
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
runner = ParallelTaskRunner()
|
runner = ParallelTaskRunner()
|
||||||
|
|
||||||
|
# Install missing brew packages first
|
||||||
|
if not install_brew_packages():
|
||||||
|
print("❌ Brew package installation failed")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
runner.add_task("Claude Code Update", "npm install -g -f @anthropic-ai/claude-code ccusage ccstatusline")
|
runner.add_task("Claude Code Update", "npm install -g -f @anthropic-ai/claude-code ccusage ccstatusline")
|
||||||
runner.add_task("Homebrew Update", "brew update && brew upgrade --greedy")
|
runner.add_task("Homebrew Update", "brew update && brew upgrade --greedy")
|
||||||
runner.add_task("Config Git Pull", "cd ~/.config && git pull")
|
runner.add_task("Config Git Pull", "cd ~/.config && git pull")
|
||||||
|
|
|
||||||
107
deploy.sh
107
deploy.sh
|
|
@ -32,105 +32,18 @@ fi
|
||||||
|
|
||||||
echo "✅ Homebrew found"
|
echo "✅ Homebrew found"
|
||||||
|
|
||||||
# Install brew packages
|
# Run upgrade-all to install/update packages
|
||||||
echo "📦 Checking brew packages..."
|
echo "📦 Running upgrade-all to install/update packages..."
|
||||||
|
if command -v upgrade-all &> /dev/null; then
|
||||||
# Get list of installed packages
|
upgrade-all
|
||||||
installed_packages=$(brew list --formula -1)
|
elif [ -x "$HOME/.config/bin/upgrade-all" ]; then
|
||||||
|
python3 "$HOME/.config/bin/upgrade-all"
|
||||||
# Function to install package if not already installed
|
else
|
||||||
install_if_missing() {
|
echo "❌ upgrade-all script not found"
|
||||||
local package="$1"
|
echo " Expected at: $HOME/.config/bin/upgrade-all"
|
||||||
local display_name="${2:-$package}"
|
exit 1
|
||||||
|
|
||||||
# Handle tap packages (contains /)
|
|
||||||
if [[ "$package" == *"/"* ]]; then
|
|
||||||
local package_name="${package##*/}" # Extract package name after last /
|
|
||||||
if ! echo "$installed_packages" | grep -q "^${package_name}$"; then
|
|
||||||
echo " 📦 Installing $display_name..."
|
|
||||||
brew install "$package"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if ! echo "$installed_packages" | grep -q "^${package}$"; then
|
|
||||||
echo " 📦 Installing $display_name..."
|
|
||||||
brew install "$package"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
# System utilities
|
|
||||||
install_if_missing "htop" # Interactive process viewer
|
|
||||||
install_if_missing "dust" # Disk usage analyzer
|
|
||||||
install_if_missing "ncdu" # Disk usage analyzer with ncurses
|
|
||||||
install_if_missing "fswatch" # File system monitoring
|
|
||||||
install_if_missing "pipx" # Install Python apps in isolation
|
|
||||||
|
|
||||||
# macOS GNU utilities
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
|
||||||
install_if_missing "coreutils" # GNU core utilities (ls, cp, mv, etc.)
|
|
||||||
install_if_missing "gnu-tar" # GNU tar archiver
|
|
||||||
install_if_missing "gnu-getopt" # GNU command line option parsing
|
|
||||||
install_if_missing "gnu-sed" # GNU stream editor
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Development tools
|
|
||||||
install_if_missing "node" # Node.js JavaScript runtime
|
|
||||||
install_if_missing "go" # Go programming language
|
|
||||||
install_if_missing "gcc" # GNU Compiler Collection
|
|
||||||
install_if_missing "gdb" # GNU debugger
|
|
||||||
install_if_missing "automake" # Build automation tool
|
|
||||||
install_if_missing "cmake" # Cross-platform build system
|
|
||||||
install_if_missing "jsdoc3" # JavaScript documentation generator
|
|
||||||
|
|
||||||
# Text processing and search
|
|
||||||
install_if_missing "ripgrep" # Fast text search (rg)
|
|
||||||
install_if_missing "the_silver_searcher" # Fast text search (ag)
|
|
||||||
install_if_missing "fd" # Fast find alternative
|
|
||||||
install_if_missing "fzf" # Fuzzy finder
|
|
||||||
install_if_missing "bat" # Better cat with syntax highlighting
|
|
||||||
install_if_missing "ccat" # Colorized cat
|
|
||||||
install_if_missing "tree" # Display directory trees
|
|
||||||
install_if_missing "jq" # JSON processor
|
|
||||||
|
|
||||||
# File management
|
|
||||||
install_if_missing "yazi" # Terminal file manager
|
|
||||||
install_if_missing "sevenzip" # File archiver
|
|
||||||
|
|
||||||
# Git and version control
|
|
||||||
install_if_missing "git" # Version control system
|
|
||||||
install_if_missing "git-delta" # Better git diff viewer
|
|
||||||
install_if_missing "git-flow" # Git branching model extensions
|
|
||||||
install_if_missing "jesseduffield/lazygit/lazygit" "lazygit" # TUI for git
|
|
||||||
install_if_missing "gh" # GitHub CLI
|
|
||||||
|
|
||||||
# Media and graphics
|
|
||||||
install_if_missing "ffmpeg" # Media processing toolkit
|
|
||||||
install_if_missing "imagemagick" # Image manipulation toolkit
|
|
||||||
install_if_missing "poppler" # PDF rendering library
|
|
||||||
install_if_missing "yt-dlp" # YouTube downloader
|
|
||||||
|
|
||||||
# Network and web
|
|
||||||
install_if_missing "wget" # Web file downloader
|
|
||||||
install_if_missing "speedtest-cli" # Internet speed test
|
|
||||||
|
|
||||||
# Terminal and shell
|
|
||||||
install_if_missing "tmux" # Terminal multiplexer
|
|
||||||
install_if_missing "neovim" # Modern Vim text editor
|
|
||||||
install_if_missing "starship" # Cross-shell prompt
|
|
||||||
install_if_missing "rainbarf" # CPU/RAM/battery stats for tmux
|
|
||||||
install_if_missing "neofetch" # System information display
|
|
||||||
install_if_missing "onefetch" # Git repository information
|
|
||||||
install_if_missing "tldr" # Simplified man pages
|
|
||||||
install_if_missing "bmon" # Bandwidth monitor
|
|
||||||
install_if_missing "loc" # Lines of code counter
|
|
||||||
|
|
||||||
# Applications
|
|
||||||
install_if_missing "awscli" # AWS command line interface
|
|
||||||
install_if_missing "azure-cli" # Azure command line interface
|
|
||||||
install_if_missing "terraform" # Infrastructure as code
|
|
||||||
|
|
||||||
echo "✅ All packages processed"
|
|
||||||
|
|
||||||
# Ensure zsh configuration is sourced
|
# Ensure zsh configuration is sourced
|
||||||
echo "🔗 Setting up zsh configuration..."
|
echo "🔗 Setting up zsh configuration..."
|
||||||
if [ ! -f "$HOME/.zshrc" ]; then
|
if [ ! -f "$HOME/.zshrc" ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue