mirror of
https://github.com/kovetskiy/mark.git
synced 2025-04-24 05:42:40 +08:00
return nil instead of exiting, check for nil in loop
This commit is contained in:
parent
611e8e9b94
commit
076165c137
4
main.go
4
main.go
@ -286,6 +286,7 @@ func RunMark(cCtx *cli.Context) error {
|
|||||||
|
|
||||||
target := processFile(file, api, cCtx, creds.PageID, creds.Username)
|
target := processFile(file, api, cCtx, creds.PageID, creds.Username)
|
||||||
|
|
||||||
|
if target != nil { // on dry-run or compile-only, the target is nil
|
||||||
log.Infof(
|
log.Infof(
|
||||||
nil,
|
nil,
|
||||||
"page successfully updated: %s",
|
"page successfully updated: %s",
|
||||||
@ -294,6 +295,7 @@ func RunMark(cCtx *cli.Context) error {
|
|||||||
|
|
||||||
fmt.Println(creds.BaseURL + target.Links.Full)
|
fmt.Println(creds.BaseURL + target.Links.Full)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,7 +417,7 @@ func processFile(
|
|||||||
|
|
||||||
html, _ := mark.CompileMarkdown(markdown, stdlib, file, cCtx.String("mermaid-provider"), cCtx.Float64("mermaid-scale"), cCtx.Bool("drop-h1"), cCtx.Bool("strip-linebreaks"))
|
html, _ := mark.CompileMarkdown(markdown, stdlib, file, cCtx.String("mermaid-provider"), cCtx.Float64("mermaid-scale"), cCtx.Bool("drop-h1"), cCtx.Bool("strip-linebreaks"))
|
||||||
fmt.Println(html)
|
fmt.Println(html)
|
||||||
os.Exit(0)
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var target *confluence.PageInfo
|
var target *confluence.PageInfo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user