feat(bootstrap): add automatic environment setup with bootstrap scripts

Implement bootstrap functionality for streamlined dotfiles setup:
- Add 'bootstrap' command to run setup scripts manually
- Auto-execute bootstrap on 'init' with remote (--no-bootstrap to skip)
- Update README with bootstrap usage and examples
- Extend tests to cover bootstrap scenarios
This commit is contained in:
Yar Kravtsov
2025-06-03 08:33:59 +03:00
parent 1e2c9704f3
commit ae9cc175ce
7 changed files with 441 additions and 15 deletions

View File

@@ -24,12 +24,17 @@ Supports both common configurations and host-specific setups.
✨ Examples:
lnk init # Fresh start
lnk init -r <repo-url> # Clone existing dotfiles
lnk init -r <repo-url> # Clone existing dotfiles (runs bootstrap automatically)
lnk add ~/.vimrc ~/.bashrc # Start managing common files
lnk add --host work ~/.ssh/config # Manage host-specific files
lnk list --all # Show all configurations
lnk pull --host work # Pull host-specific changes
lnk push "setup complete" # Sync to remote
lnk bootstrap # Run bootstrap script manually
🚀 Bootstrap Support:
Automatically runs bootstrap.sh when cloning a repository.
Use --no-bootstrap to disable.
🎯 Simple, fast, Git-native, and multi-host ready.`,
SilenceUsage: true,
@@ -45,6 +50,7 @@ Supports both common configurations and host-specific setups.
rootCmd.AddCommand(newStatusCmd())
rootCmd.AddCommand(newPushCmd())
rootCmd.AddCommand(newPullCmd())
rootCmd.AddCommand(newBootstrapCmd())
return rootCmd
}