Auto-sync from catchthesethighs
This commit is contained in:
@@ -28,13 +28,17 @@ for arg in "$@"; do
|
||||
QUIET_MODE=true
|
||||
;;
|
||||
--help|-h)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo "Usage: dotfiles-doctor.sh [OPTIONS]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " --fix Attempt to automatically fix issues"
|
||||
echo " --quiet Only show errors and warnings"
|
||||
echo " --help Show this help message"
|
||||
echo
|
||||
echo "Aliases:"
|
||||
echo " dfd, doctor Run diagnostics"
|
||||
echo " dffix Run with --fix"
|
||||
echo
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
@@ -448,7 +452,7 @@ print_summary() {
|
||||
else
|
||||
echo -e "${RED}✗ Some issues found.${NC}"
|
||||
if [[ "$FIX_MODE" != true ]]; then
|
||||
echo -e " Run with ${CYAN}--fix${NC} to attempt automatic fixes."
|
||||
echo -e " Run ${CYAN}dffix${NC} or ${CYAN}dotfiles-doctor.sh --fix${NC} to attempt automatic fixes."
|
||||
fi
|
||||
fi
|
||||
echo
|
||||
|
||||
7
bin/dotfile-stats.sh → bin/dotfiles-stats.sh
Executable file → Normal file
7
bin/dotfile-stats.sh → bin/dotfiles-stats.sh
Executable file → Normal file
@@ -419,7 +419,7 @@ show_heatmap() {
|
||||
# ============================================================================
|
||||
|
||||
show_help() {
|
||||
echo "Usage: $0 [COMMAND] [OPTIONS]"
|
||||
echo "Usage: dotfiles-stats.sh [COMMAND] [OPTIONS]"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " (none) Show dashboard"
|
||||
@@ -434,6 +434,11 @@ show_help() {
|
||||
echo " --export Export stats as JSON"
|
||||
echo " --help Show this help"
|
||||
echo
|
||||
echo "Aliases:"
|
||||
echo " dfstats, stats Show dashboard"
|
||||
echo " tophist Top commands"
|
||||
echo " suggest Suggest aliases"
|
||||
echo
|
||||
}
|
||||
|
||||
main() {
|
||||
@@ -319,13 +319,13 @@ do_auto() {
|
||||
|
||||
if [[ $behind -gt 0 ]]; then
|
||||
echo -e "${YELLOW}⚠ Dotfiles: $behind update(s) available${NC}"
|
||||
echo -e " Run: ${CYAN}dotfiles-sync.sh --pull${NC}"
|
||||
echo -e " Run: ${CYAN}dfpull${NC} or ${CYAN}dotfiles-sync.sh --pull${NC}"
|
||||
fi
|
||||
|
||||
if has_local_changes; then
|
||||
local changed=$(git status --short 2>/dev/null | wc -l | tr -d ' ')
|
||||
echo -e "${YELLOW}⚠ Dotfiles: $changed local change(s) not pushed${NC}"
|
||||
echo -e " Run: ${CYAN}dotfiles-sync.sh --push${NC}"
|
||||
echo -e " Run: ${CYAN}dfpush${NC} or ${CYAN}dotfiles-sync.sh --push${NC}"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ show_conflicts() {
|
||||
# ============================================================================
|
||||
|
||||
show_help() {
|
||||
echo "Usage: $0 [COMMAND] [OPTIONS]"
|
||||
echo "Usage: dotfiles-sync.sh [COMMAND] [OPTIONS]"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " (none) Interactive sync"
|
||||
@@ -396,10 +396,17 @@ show_help() {
|
||||
echo " --conflicts Show merge conflicts"
|
||||
echo " --help Show this help"
|
||||
echo
|
||||
echo "Aliases:"
|
||||
echo " dfs, dfsync Interactive sync"
|
||||
echo " dfpush Push local changes"
|
||||
echo " dfpull Pull remote changes"
|
||||
echo " dfstatus Show sync status"
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " $0 # Interactive sync"
|
||||
echo " $0 --push 'Added aliases' # Push with message"
|
||||
echo " $0 --watch 60 # Sync every 60 seconds"
|
||||
echo " dfs # Interactive sync"
|
||||
echo " dfpush # Push changes"
|
||||
echo " dotfiles-sync.sh --push 'Added aliases'"
|
||||
echo " dotfiles-sync.sh --watch 60 # Sync every 60 seconds"
|
||||
echo
|
||||
}
|
||||
|
||||
|
||||
@@ -434,7 +434,8 @@ vault_status() {
|
||||
# ============================================================================
|
||||
|
||||
show_help() {
|
||||
echo "Usage: vault <command> [args]"
|
||||
echo "Usage: dotfiles-vault.sh <command> [args]"
|
||||
echo " vault <command> [args]"
|
||||
echo
|
||||
echo "Commands:"
|
||||
echo " set <key> [value] Store a secret (prompts for value if not given)"
|
||||
@@ -448,10 +449,17 @@ show_help() {
|
||||
echo " init Initialize vault"
|
||||
echo " help Show this help"
|
||||
echo
|
||||
echo "Aliases:"
|
||||
echo " vault Main command (alias for dotfiles-vault.sh)"
|
||||
echo " vls List secrets"
|
||||
echo " vget <key> Get secret"
|
||||
echo " vset <key> Set secret"
|
||||
echo
|
||||
echo "Examples:"
|
||||
echo " vault set GITHUB_TOKEN ghp_xxxxxxxxxxxx"
|
||||
echo " vault set AWS_SECRET_KEY # Will prompt for value"
|
||||
echo " vault get GITHUB_TOKEN"
|
||||
echo " vget GITHUB_TOKEN"
|
||||
echo " vls"
|
||||
echo " eval \$(vault shell) # Export all to current shell"
|
||||
echo
|
||||
echo "The vault uses ${CYAN}age${NC} or ${CYAN}gpg${NC} for encryption."
|
||||
|
||||
@@ -50,12 +50,15 @@ for arg in "$@"; do
|
||||
CHECK_ONLY=true
|
||||
;;
|
||||
--help|-h)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo "Usage: dotfiles-version.sh [OPTIONS]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " --check Only check for updates (exit 1 if behind)"
|
||||
echo " --help Show this help message"
|
||||
echo
|
||||
echo "Aliases:"
|
||||
echo " dfv, dfversion Show version info"
|
||||
echo
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
@@ -214,9 +217,8 @@ main() {
|
||||
echo -e " Commits: ${YELLOW}⚠ ${commits_behind} commit(s) behind${NC}"
|
||||
echo
|
||||
echo -e "${YELLOW}To update:${NC}"
|
||||
echo " cd ~/.dotfiles && git pull && ./install.sh"
|
||||
echo " # or"
|
||||
echo " update-dotfiles.sh"
|
||||
echo " dfu # Alias"
|
||||
echo " dotfiles-update.sh # Full command"
|
||||
elif [[ "$commits_behind" == "0" ]]; then
|
||||
echo -e " Commits: ${GREEN}✓ Up to date${NC}"
|
||||
fi
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
# Updates dotfiles from the git repository and relinks files
|
||||
#
|
||||
# Usage:
|
||||
# update-dotfiles.sh # Pull and re-run install
|
||||
# update-dotfiles.sh --skip-deps # Pull and re-run install without deps
|
||||
# update-dotfiles.sh --pull-only # Only git pull, don't re-run install
|
||||
# dotfiles-update.sh # Pull and re-run install
|
||||
# dotfiles-update.sh --skip-deps # Pull and re-run install without deps
|
||||
# dotfiles-update.sh --pull-only # Only git pull, don't re-run install
|
||||
#
|
||||
# Aliases: dfu, dfupdate
|
||||
# ============================================================================
|
||||
|
||||
set -e
|
||||
@@ -31,7 +33,7 @@ for arg in "$@"; do
|
||||
PULL_ONLY=true
|
||||
;;
|
||||
--help|-h)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo "Usage: dotfiles-update.sh [OPTIONS]"
|
||||
echo
|
||||
echo "Options:"
|
||||
echo " --skip-deps Skip dependency check (default for updates)"
|
||||
@@ -39,6 +41,9 @@ for arg in "$@"; do
|
||||
echo " --pull-only Only git pull, don't re-run install script"
|
||||
echo " --help Show this help message"
|
||||
echo
|
||||
echo "Aliases:"
|
||||
echo " dfu, dfupdate Update dotfiles"
|
||||
echo
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
@@ -71,6 +76,7 @@ GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
BLUE='\033[0;34m'
|
||||
CYAN='\033[0;36m'
|
||||
NC='\033[0m'
|
||||
|
||||
print_success() {
|
||||
@@ -131,7 +137,7 @@ if [ $? -eq 0 ]; then
|
||||
|
||||
echo
|
||||
print_success "Update complete!"
|
||||
echo "Reload your shell with: source ~/.zshrc"
|
||||
echo -e "Reload your shell: ${CYAN}reload${NC} or ${CYAN}source ~/.zshrc${NC}"
|
||||
else
|
||||
print_error "Failed to update dotfiles"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user