Skip to content
Merged
27 changes: 27 additions & 0 deletions homebrew-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Homebrew Scripts

Opinionated but safe Homebrew automation scripts for macOS.

These scripts wrap common Homebrew operations into repeatable,
readable shell commands.

## Included scripts

| Script | Purpose |
|------|--------|
| update-brew.sh | Update Homebrew and upgrade all packages |
| check-outdated.sh | Show outdated formulae |
| cleanup-brew.sh | Remove old versions and unused deps |
| install-common-tools.sh | Install common dev tools |
| install-languages.sh | Install additional languages |
| install-utilities.sh | Install CLI utilities |
| minimal-install.sh | Minimal example (Git only) |

## Running

```bash
chmod +x *.sh
./update-brew.sh
```

Homebrew must be installed beforehand.
11 changes: 11 additions & 0 deletions homebrew-scripts/check-outdated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Safe Homebrew check script
# Lists outdated packages

set -euo pipefail

echo "Checking for outdated Homebrew packages..."
brew outdated

echo "Check completed. Run update-brew.sh to upgrade."
16 changes: 16 additions & 0 deletions homebrew-scripts/cleanup-brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

# Safe Homebrew cleanup script
# Removes old versions and unused dependencies

set -euo pipefail

echo "Cleaning up Homebrew..."

# Remove old versions of formulae
brew cleanup

# Remove formulae that are no longer needed
brew autoremove

echo "Homebrew cleanup completed successfully."
23 changes: 23 additions & 0 deletions homebrew-scripts/install-common-tools.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# Safe Homebrew install script for common development tools
# Installs frequently used packages for development

set -euo pipefail

echo "Installing common development tools via Homebrew..."

# Version control, languages, runtimes, and tools
brew install \
git \
python@3.12 \
node \
rust \
go \
yarn \
jq \
tree \
wget

echo "Common development tools installed successfully."
echo "Note: Python is installed as python@3.12. Use 'python3' to run it."
15 changes: 15 additions & 0 deletions homebrew-scripts/install-languages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Safe Homebrew install script for programming languages
# Installs additional programming languages and runtimes

set -euo pipefail

echo "Installing additional programming languages via Homebrew..."

brew install ruby \
php \
lua \
perl

echo "Additional programming languages installed successfully."
17 changes: 17 additions & 0 deletions homebrew-scripts/install-utilities.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Safe Homebrew install script for common utilities
# Installs useful command-line utilities

set -euo pipefail

echo "Installing common utilities via Homebrew..."

brew install htop \
tmux \
vim \
neovim \
curl \
git-lfs

echo "Common utilities installed successfully."
17 changes: 17 additions & 0 deletions homebrew-scripts/minimal-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

# Minimal Homebrew Install Script
# This script demonstrates a basic, safe Homebrew installation example.
# It installs only the essential Git version control system, which is fundamental for development workflows.
# Unlike the other scripts that install multiple packages, this focuses on a single, core tool to illustrate minimal dependency management.
# In software engineering, minimalism in tooling reduces complexity, potential conflicts, and maintenance overhead.
# By starting with Git, this script ensures version control is available before adding more tools, following the principle of progressive enhancement.
# Reference: Homebrew's philosophy emphasizes simplicity and safety, aligning with this minimal approach to avoid overwhelming new users.
# This prevents "bandwidth noise" by providing a focused, educational example rather than a bloated installation.

set -euo pipefail

echo "Installing minimal essential tool: Git"
brew install git

echo "Minimal installation completed. Git is now available for version control."
14 changes: 14 additions & 0 deletions homebrew-scripts/update-brew.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

# Safe Homebrew update script
# Updates Homebrew formulae and upgrades installed packages

set -euo pipefail

echo "Updating Homebrew..."
brew update

echo "Upgrading installed packages..."
brew upgrade

echo "Homebrew update and upgrade completed successfully."