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