mirror of
https://github.com/dnote/dnote
synced 2026-03-18 00:09:56 +01:00
Validate book name (#185)
This commit is contained in:
parent
f526124243
commit
813040ea21
1 changed files with 4 additions and 0 deletions
|
|
@ -98,6 +98,10 @@ func newRun(ctx infra.DnoteCtx) core.RunEFunc {
|
|||
return func(cmd *cobra.Command, args []string) error {
|
||||
bookName := args[0]
|
||||
|
||||
if err := validateBookName(bookName); err != nil {
|
||||
return errors.Wrap(err, "invalid book name")
|
||||
}
|
||||
|
||||
if content == "" {
|
||||
fpath := core.GetDnoteTmpContentPath(ctx)
|
||||
err := core.GetEditorInput(ctx, fpath, &content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue