1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-07-30 13:47:46 +00:00

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.
This commit is contained in:
Nguyễn Hồng Quân 2025-05-04 06:25:23 +07:00 committed by GitHub
parent e82487722b
commit 54f10ee7ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,7 +73,8 @@ module lftp-completion-utils {
export def get-bookmark-sites []: nothing -> table<value: string, description: string> {
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)" }
}
}