mirror of
https://github.com/go-shiori/shiori.git
synced 2025-01-17 05:17:59 +08:00
Fix: unable to use empty string as excerpt
This commit is contained in:
parent
035e83746b
commit
9d3c8eedf9
1 changed files with 7 additions and 2 deletions
|
@ -32,7 +32,7 @@ var (
|
|||
skipConfirmation, _ := cmd.Flags().GetBool("yes")
|
||||
|
||||
// Check if --url flag is used
|
||||
if url != "" {
|
||||
if cmd.Flags().Changed("url") {
|
||||
if len(args) != 1 {
|
||||
cError.Println("Update only accepts one index while using --url flag")
|
||||
return
|
||||
|
@ -45,6 +45,11 @@ var (
|
|||
}
|
||||
}
|
||||
|
||||
// Check if --excerpt flag is used
|
||||
if !cmd.Flags().Changed("excerpt") {
|
||||
excerpt = "|-|-|"
|
||||
}
|
||||
|
||||
// If no arguments, confirm to user
|
||||
if len(args) == 0 && !skipConfirmation {
|
||||
confirmUpdate := ""
|
||||
|
@ -153,7 +158,7 @@ func updateBookmarks(indices []string, url, title, excerpt string, tags []string
|
|||
bookmarks[i].Title = title
|
||||
}
|
||||
|
||||
if excerpt != "" {
|
||||
if excerpt != "|-|-|" {
|
||||
bookmarks[i].Excerpt = excerpt
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue