mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-31 14:17:45 +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:
parent
e82487722b
commit
54f10ee7ee
1 changed files with 2 additions and 1 deletions
|
@ -73,7 +73,8 @@ module lftp-completion-utils {
|
||||||
|
|
||||||
export def get-bookmark-sites []: nothing -> table<value: string, description: string> {
|
export def get-bookmark-sites []: nothing -> table<value: string, description: string> {
|
||||||
const FILE_PATH = '~/.local/share/lftp/bookmarks' | path expand
|
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)" }
|
$sites | update value { $"bm:($in)" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue