From 54f10ee7ee8a462849ca0471b41abcf8eab73155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20H=E1=BB=93ng=20Qu=C3=A2n?= Date: Sun, 4 May 2025 06:25:23 +0700 Subject: [PATCH] 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. --- custom-completions/lftp/lftp-completions.nu | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom-completions/lftp/lftp-completions.nu b/custom-completions/lftp/lftp-completions.nu index 9611133..7f3216f 100644 --- a/custom-completions/lftp/lftp-completions.nu +++ b/custom-completions/lftp/lftp-completions.nu @@ -73,7 +73,8 @@ module lftp-completion-utils { export def get-bookmark-sites []: nothing -> table { const FILE_PATH = '~/.local/share/lftp/bookmarks' | path expand - let sites = open --raw $FILE_PATH | lines | split column -n 2 -r \s+ value description + let sites = try { open --raw $FILE_PATH | lines } catch { [] } + | split column -n 2 -r \s+ value description $sites | update value { $"bm:($in)" } } }