Skip to content

Commit

Permalink
allow skipping validation in [update]
Browse files Browse the repository at this point in the history
  • Loading branch information
jippi committed Feb 11, 2024
1 parent 9eff7a0 commit 8a9d271
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func Command() *cobra.Command {

cmd.Flags().String("source", "", "URL or local file path to the upstream source file. This will take precedence over any [@dottie/source] annotation in the file")
shared.BoolWithInverse(cmd, "error-on-missing-key", true, "Error if a KEY in FILE is missing from SOURCE", "Add KEY to FILE if missing from SOURCE")
shared.BoolWithInverse(cmd, "validate", true, "Validation errors will abort the update", "Validation errors will be printed but will not fail the update")

return cmd
}
Expand Down Expand Up @@ -231,7 +232,7 @@ func runE(cmd *cobra.Command, args []string) error {

dark.Println()

if sawError {
if sawError && shared.BoolWithInverseValue(cmd.Flags(), "validate") {
return errors.New("some fields failed validation, aborting ...")
}

Expand Down

0 comments on commit 8a9d271

Please sign in to comment.