Fix gum file browser returning relative paths

gum file returns paths relative to the start directory.
Prepend / to ensure absolute paths for backup targets.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
shuki
2026-03-05 22:29:30 +02:00
parent f80c786597
commit a956bd9e30

View File

@@ -152,6 +152,8 @@ ui_target_folder_picker() {
path=$(gum file --directory --header "Select folder to back up" \ path=$(gum file --directory --header "Select folder to back up" \
--cursor.foreground "$_GUM_ACCENT" --height 15 /) || continue --cursor.foreground "$_GUM_ACCENT" --height 15 /) || continue
[[ -z "$path" ]] && continue [[ -z "$path" ]] && continue
# gum file returns path relative to start dir — make absolute
[[ "$path" != /* ]] && path="/$path"
# Avoid duplicates # Avoid duplicates
local dup=false local dup=false
for f in "${folders[@]}"; do for f in "${folders[@]}"; do