-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
Installation scripts lack consistency in style, formatting, and patterns, making the codebase harder to maintain and contribute to.
Inconsistencies
1. Output Formatting
- Some scripts use
echo, others useprintf - Some use emojis (🛠, ✅, 🔑), others don't
- No consistent logging format
bootstrap.shhas nice colored output functions (info, success, fail) but they're not used in individual install scripts
2. Code Style
- Mixed indentation (tabs vs spaces)
- Inconsistent variable naming
- Some scripts have descriptive comments, others don't
- Different approaches to checking command existence (
test $(which cmd)vscommand -v cmd)
3. Script Structure
- No common pattern across install.sh files
- Some scripts are verbose, others minimal
- Inconsistent error handling patterns
- No standard header/documentation format
Impact
- Harder to review changes
- Inconsistent user experience
- Makes automation and tooling difficult
- Higher barrier for contributors
Recommended Solution
1. Create a Style Guide
Document in AGENTS.md or CONTRIBUTING.md:
- Use
printffor output (more portable thanecho) - Use emojis consistently or not at all
- Standard indentation (2 spaces or tabs - pick one)
- Naming conventions for variables (UPPERCASE for globals/env vars, lowercase for locals)
- Comment standards
2. Create Shared Functions
Move bootstrap.sh output functions to a shared file:
# dotfiles/lib/functions.sh
info() { printf "\r [ \033[00;34m..\033[0m ] $1\n"; }
user() { printf "\r [ \033[0;33m??\033[0m ] $1\n"; }
success() { printf "\r\033[2K [ \033[00;32mOK\033[0m ] $1\n"; }
fail() { printf "\r\033[2K [\033[0;31mFAIL\033[0m] $1\n"; }Then source in scripts:
source ~/.dotfiles/lib/functions.sh
info "Installing something..."3. Create Template Scripts
Provide template files for new topics:
_template/install.sh_template/preinstall.sh_template/env.zsh
4. Standardize Command Checks
Use consistent pattern:
if ! command -v tool &> /dev/null; then
fail "tool not found"
fiSuccess Criteria
- Documented style guide
- Shared utility functions
- Template scripts for new topics
- Consistent look and feel across all scripts
Priority
LOW - Nice to have, should be done incrementally as other issues are addressed
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request