Skip to content

Commit

Permalink
fix: added missing error handling for write and recursive flag checks
Browse files Browse the repository at this point in the history
  • Loading branch information
brittonhayes committed Oct 4, 2024
1 parent db1f3ae commit 898d43c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cmd/substation/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,15 @@ Supported file extensions: .jsonnet, .libsonnet`,
path = args[0]
}

write, _ := cmd.Flags().GetBool("write")
recursive, _ := cmd.Flags().GetBool("recursive")
write, err := cmd.Flags().GetBool("write")
if err != nil {
return err
}

recursive, err := cmd.Flags().GetBool("recursive")
if err != nil {
return err
}

return formatPath(path, write, recursive)
},
Expand Down

0 comments on commit 898d43c

Please sign in to comment.