Dotfiles update 2025-12-25 20:25
This commit is contained in:
@@ -13,6 +13,7 @@ source "${DOTFILES_HOME:-$HOME/.dotfiles}/zsh/lib/bootstrap.zsh" 2>/dev/null ||
|
|||||||
echo "Warning: bootstrap.zsh not found, using fallbacks"
|
echo "Warning: bootstrap.zsh not found, using fallbacks"
|
||||||
DF_RED=$'\033[0;31m' DF_GREEN=$'\033[0;32m' DF_YELLOW=$'\033[1;33m'
|
DF_RED=$'\033[0;31m' DF_GREEN=$'\033[0;32m' DF_YELLOW=$'\033[1;33m'
|
||||||
DF_BLUE=$'\033[0;34m' DF_CYAN=$'\033[0;36m' DF_NC=$'\033[0m'
|
DF_BLUE=$'\033[0;34m' DF_CYAN=$'\033[0;36m' DF_NC=$'\033[0m'
|
||||||
|
DF_LIGHT_GREY=$'\033[0;37m'
|
||||||
DOTFILES_HOME="${DOTFILES_HOME:-$HOME/.dotfiles}"
|
DOTFILES_HOME="${DOTFILES_HOME:-$HOME/.dotfiles}"
|
||||||
df_print_header() { echo "=== $1 ==="; }
|
df_print_header() { echo "=== $1 ==="; }
|
||||||
df_print_success() { echo -e "${DF_GREEN}✓${DF_NC} $1"; }
|
df_print_success() { echo -e "${DF_GREEN}✓${DF_NC} $1"; }
|
||||||
@@ -188,37 +189,58 @@ check_dotfiles_dir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_bin_scripts() {
|
check_bin_scripts() {
|
||||||
print_section "Bin Script Symlinks: ${DF_LIGHT_GREY}.local/bin${DF_NC}"
|
print_section "Bin Script Symlinks: ${DF_LIGHT_GREY}~/.local/bin${DF_NC}"
|
||||||
|
|
||||||
local scripts=(
|
# Ensure ~/.local/bin exists
|
||||||
"dotfiles-analytics.sh"
|
if [[ ! -d "$HOME/.local/bin" ]]; then
|
||||||
"dotfiles-compile.sh"
|
check_warn "~/.local/bin does not exist"
|
||||||
"dotfiles-diff.sh"
|
if [[ "$DO_FIX" == true ]]; then
|
||||||
"dotfiles-doctor.sh"
|
mkdir -p "$HOME/.local/bin"
|
||||||
"dotfiles-stats.sh"
|
check_fixed "Created ~/.local/bin"
|
||||||
"dotfiles-sync.sh"
|
else
|
||||||
"dotfiles-tour.sh"
|
return
|
||||||
"dotfiles-update.sh"
|
fi
|
||||||
"dotfiles-vault.sh"
|
fi
|
||||||
"dotfiles-version.sh"
|
|
||||||
"dotfiles-profile.sh"
|
|
||||||
)
|
|
||||||
|
|
||||||
for script in "${scripts[@]}"; do
|
# Iterate directly over scripts in bin directory
|
||||||
if [[ -x "$HOME/.local/bin/$script" ]]; then
|
for script_path in "$DOTFILES_HOME/bin"/*.sh; do
|
||||||
check_pass "$script"
|
# Skip if no matches (glob returned literal)
|
||||||
elif [[ -f "$HOME/.local/bin/$script" ]]; then
|
[[ -f "$script_path" ]] || continue
|
||||||
check_warn "$script exists but not executable"
|
|
||||||
if [[ "$DO_FIX" == true ]]; then
|
local script=$(basename "$script_path")
|
||||||
chmod +x "$HOME/.local/bin/$script"
|
local target="$HOME/.local/bin/$script"
|
||||||
check_fixed "Made executable: $script"
|
|
||||||
|
if [[ -L "$target" ]]; then
|
||||||
|
# It's a symlink
|
||||||
|
if [[ -e "$target" ]]; then
|
||||||
|
# Valid symlink
|
||||||
|
check_pass "$script"
|
||||||
|
else
|
||||||
|
# Broken symlink
|
||||||
|
check_fail "$script is broken symlink"
|
||||||
|
if [[ "$DO_FIX" == true ]]; then
|
||||||
|
rm "$target"
|
||||||
|
ln -s "$script_path" "$target"
|
||||||
|
check_fixed "Recreated symlink: $script"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [[ -f "$target" ]]; then
|
||||||
|
# Regular file (not symlink)
|
||||||
|
if [[ -x "$target" ]]; then
|
||||||
|
check_warn "$script is regular file (not symlink)"
|
||||||
|
else
|
||||||
|
check_warn "$script exists but not executable"
|
||||||
|
if [[ "$DO_FIX" == true ]]; then
|
||||||
|
chmod +x "$target"
|
||||||
|
check_fixed "Made executable: $script"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
# Doesn't exist
|
||||||
check_fail "$script not linked"
|
check_fail "$script not linked"
|
||||||
if [[ "$DO_FIX" == true ]]; then
|
if [[ "$DO_FIX" == true ]]; then
|
||||||
ln -s "$DOTFILES_HOME/bin/$script" "$HOME/.local/bin/$script"
|
ln -s "$script_path" "$target"
|
||||||
chmod +x "$HOME/.local/bin/$script"
|
check_fixed "Created symlink: $script"
|
||||||
check_fixed "Created executable symlink: $script"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ main() {
|
|||||||
# Full output
|
# Full output
|
||||||
df_print_header "dotfiles-version"
|
df_print_header "dotfiles-version"
|
||||||
|
|
||||||
|
echo ""
|
||||||
echo -e "${DF_CYAN}Local:${DF_NC}"
|
echo -e "${DF_CYAN}Local:${DF_NC}"
|
||||||
echo -e " Version: ${DF_GREEN}${DOTFILES_VERSION}${DF_NC}"
|
echo -e " Version: ${DF_GREEN}${DOTFILES_VERSION}${DF_NC}"
|
||||||
echo -e " Commit: ${local_commit}"
|
echo -e " Commit: ${local_commit}"
|
||||||
|
|||||||
Reference in New Issue
Block a user