Skip to content

Commit 54f10ee

Browse files
authored
Fix when lftp bookmark file is not readable (#1114)
Sorry, in the #1113 , I forgot to test the case that `lftp`'s bookmark file is not readable.
1 parent e824877 commit 54f10ee

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom-completions/lftp/lftp-completions.nu

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ module lftp-completion-utils {
7373

7474
export def get-bookmark-sites []: nothing -> table<value: string, description: string> {
7575
const FILE_PATH = '~/.local/share/lftp/bookmarks' | path expand
76-
let sites = open --raw $FILE_PATH | lines | split column -n 2 -r \s+ value description
76+
let sites = try { open --raw $FILE_PATH | lines } catch { [] }
77+
| split column -n 2 -r \s+ value description
7778
$sites | update value { $"bm:($in)" }
7879
}
7980
}

0 commit comments

Comments
 (0)