Dotfiles Scripts - lars-hagen/dotfiles GitHub Wiki
Utility Scripts
This document describes the utility scripts available in the bin/ directory of our dotfiles.
Available Scripts
dotfiles-manage
A utility for managing dotfiles:
- Adds new files to the dotfiles repository
- Creates appropriate symlinks
- Maintains consistent structure
Usage:
dotfiles-manage add ~/.config/some-config # Add a new file/directory
dotfiles-dump-brew
Manages the Brewfile:
- Dumps current Homebrew packages to Brewfile
- Includes formulae, casks, and VSCode extensions
- Maintains consistent formatting
Usage:
dotfiles-dump-brew # Update Brewfile with current packages
Script Conventions
- Naming: Scripts follow the
dotfiles-*naming convention - Location: All scripts are stored in
$DOTFILES_DIR/bin - Execution: Scripts are available in PATH via
.zshrcconfiguration - Error Handling: All scripts use
set -eandset -ufor robust error handling
Common Features
All scripts share these common features:
- Directory Resolution: Use
$DOTFILES_DIRfor consistent paths - Error Checking: Validate inputs and dependencies
- Helpful Messages: Clear output for user feedback
- Safe Operations: Confirm before destructive actions
Development Guidelines
When creating new utility scripts:
- Follow the
dotfiles-*naming convention - Add to
bin/directory - Make executable (
chmod +x) - Use shellcheck for validation
- Add documentation in this wiki
- Test on both macOS and Linux if applicable