forked from Shinonome/dots-hyprland
Maybe something fixed?
This commit is contained in:
+25
-3
@@ -850,14 +850,13 @@ if [[ "$process_files" == true ]]; then
|
|||||||
files_processed=0
|
files_processed=0
|
||||||
files_updated=0
|
files_updated=0
|
||||||
files_created=0
|
files_created=0
|
||||||
|
files_skipped=0
|
||||||
|
|
||||||
for dir_name in "${MONITOR_DIRS[@]}"; do
|
for dir_name in "${MONITOR_DIRS[@]}"; do
|
||||||
repo_dir_path="${REPO_DIR}/${dir_name}"
|
repo_dir_path="${REPO_DIR}/${dir_name}"
|
||||||
|
|
||||||
if [[ ! -d "$repo_dir_path" ]]; then
|
if [[ ! -d "$repo_dir_path" ]]; then
|
||||||
if [[ "$VERBOSE" == true ]]; then
|
log_warning "Skipping non-existent directory: $repo_dir_path"
|
||||||
log_warning "Skipping non-existent directory: $repo_dir_path"
|
|
||||||
fi
|
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -879,19 +878,35 @@ if [[ "$process_files" == true ]]; then
|
|||||||
log_info "[DRY-RUN] Would create directory: $home_dir_path"
|
log_info "[DRY-RUN] Would create directory: $home_dir_path"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Debug: Check what files are found
|
||||||
|
if [[ "$VERBOSE" == true ]]; then
|
||||||
|
log_info "Looking for files in: $repo_dir_path"
|
||||||
|
fi
|
||||||
|
|
||||||
while IFS= read -r -d '' repo_file; do
|
while IFS= read -r -d '' repo_file; do
|
||||||
# Calculate relative path from the repo source directory
|
# Calculate relative path from the repo source directory
|
||||||
rel_path="${repo_file#$repo_dir_path/}"
|
rel_path="${repo_file#$repo_dir_path/}"
|
||||||
home_file="${home_dir_path}/${rel_path}"
|
home_file="${home_dir_path}/${rel_path}"
|
||||||
|
|
||||||
|
if [[ "$VERBOSE" == true ]]; then
|
||||||
|
log_info "Checking file: $rel_path"
|
||||||
|
fi
|
||||||
|
|
||||||
if should_ignore "$home_file"; then
|
if should_ignore "$home_file"; then
|
||||||
|
if [[ "$VERBOSE" == true ]]; then
|
||||||
|
log_info "Skipping ignored file: $home_file"
|
||||||
|
fi
|
||||||
|
((files_skipped++))
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
((files_processed++))
|
((files_processed++))
|
||||||
|
|
||||||
|
# Ensure parent directory exists
|
||||||
if [[ "$DRY_RUN" != true ]]; then
|
if [[ "$DRY_RUN" != true ]]; then
|
||||||
mkdir -p "$(dirname "$home_file")"
|
mkdir -p "$(dirname "$home_file")"
|
||||||
|
else
|
||||||
|
log_info "[DRY-RUN] Would create directory: $(dirname "$home_file")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$home_file" ]]; then
|
if [[ -f "$home_file" ]]; then
|
||||||
@@ -901,14 +916,20 @@ if [[ "$process_files" == true ]]; then
|
|||||||
log_warning "[DRY-RUN] Conflict detected (would prompt): $home_file"
|
log_warning "[DRY-RUN] Conflict detected (would prompt): $home_file"
|
||||||
((files_updated++))
|
((files_updated++))
|
||||||
else
|
else
|
||||||
|
log_info "Handling conflict for: $home_file"
|
||||||
handle_file_conflict "$repo_file" "$home_file"
|
handle_file_conflict "$repo_file" "$home_file"
|
||||||
((files_updated++))
|
((files_updated++))
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if [[ "$VERBOSE" == true ]]; then
|
||||||
|
log_info "No changes in: $rel_path"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ "$DRY_RUN" == true ]]; then
|
if [[ "$DRY_RUN" == true ]]; then
|
||||||
log_info "[DRY-RUN] Would create new file: $home_file"
|
log_info "[DRY-RUN] Would create new file: $home_file"
|
||||||
else
|
else
|
||||||
|
log_info "Creating new file: $home_file"
|
||||||
cp -p "$repo_file" "$home_file"
|
cp -p "$repo_file" "$home_file"
|
||||||
log_success "Created new file: $home_file"
|
log_success "Created new file: $home_file"
|
||||||
fi
|
fi
|
||||||
@@ -922,6 +943,7 @@ if [[ "$process_files" == true ]]; then
|
|||||||
log_info "- Files processed: $files_processed"
|
log_info "- Files processed: $files_processed"
|
||||||
log_info "- Files with conflicts: $files_updated"
|
log_info "- Files with conflicts: $files_updated"
|
||||||
log_info "- New files created: $files_created"
|
log_info "- New files created: $files_created"
|
||||||
|
log_info "- Files skipped (ignored): $files_skipped"
|
||||||
else
|
else
|
||||||
log_info "Skipping file updates (no changes detected and not in force mode)"
|
log_info "Skipping file updates (no changes detected and not in force mode)"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user