This document contains instructions for developers who maintain this Homebrew tap.
The repository uses a Makefile to simplify formula maintenance and testing with an isolated testing environment.
When updating the formula to the latest version:
-
Run the update script:
make update
This will automatically fetch the latest version and update the formula file.
-
Test and verify with a single command:
make testThis will:
- Clean any previous test installs
- Create a local tap
- Install the formula
- Verify the installed version matches the formula
-
Commit and push changes once tests pass.
-
Clone the repository:
git clone https://github.com/onegrep/homebrew-tap.git cd homebrew-tap -
Run formula style check:
make style make lint
-
Test the complete installation:
make test -
For manual verification:
# Install without testing make install # Try the CLI toolprint --help
- Testing uses an isolated tap called
toolprint/tap-local - The tap is recreated fresh for each test (cleaned first)
- All tests use your local formula file
- Formula version is automatically extracted and verified
make style - Check formula style (basic syntax check)
make lint - Run style checks
make clean - Remove local tap and clear Homebrew caches
make tap - Tap local repository for testing
make install - Clean, tap and install formula
make version - Show the current version of the package in the formula
make update - Update the version of the package in the formula
make test - Complete test: clean, install and verify version
The formula (toolprint.rb) follows standard Homebrew conventions:
- Class name matches the formula name in CamelCase (
Toolprint) - Supports multiple architectures (ARM64, x86_64 for macOS, x86_64 for Linux)
- Uses NPM to install from the registry
- Includes SHA256 checksums for verification
-
Update the formula to the latest version:
make update
-
Test and verify the new version:
make test -
Commit and push changes to release.
-
Users can update with:
brew update brew upgrade toolprint
- Formula syntax errors: Run
make lintto detect basic syntax issues - Installation problems: Use
brew install --verbose --formula ./Formula/toolprint.rbfor detailed output - SHA mismatch: Verify checksums match the distributed binaries
- Version mismatch: Ensure the binary version output matches formula version
# See detailed install information
brew install --debug --verbose --formula ./Formula/toolprint.rb
# Clean Homebrew's cache
brew cleanup
# Get formula info
brew info ./Formula/toolprint.rb