Skip to content

Commit

Permalink
fixed the error reporting of admin update/delete commands
Browse files Browse the repository at this point in the history
  • Loading branch information
ganigeorgiev committed Feb 6, 2024
1 parent 442b286 commit 722a749
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
_This should also fix the SVG/JSON zero response when using Cloudflare R2 ([#4287](https://github.com/pocketbase/pocketbase/issues/4287#issuecomment-1925168142), [#2068](https://github.com/pocketbase/pocketbase/discussions/2068), [#2952](https://github.com/pocketbase/pocketbase/discussions/2952))._
_If you are using S3, please verify that you have a green check in the Admin UI for your S3 configuration (I've tested the new version with GCS, MinIO, Cloudflare R2 and Wasabi)._

- Other minor improvements (updated the `ghupdate` plugin to use the configured executable name when printing to the console, increased with +1 the `thumbGenSem` limit, etc.).
- Other minor improvements (updated the `ghupdate` plugin to use the configured executable name when printing to the console, increased with +1 the `thumbGenSem` limit, fixed the error reporting of `admin update/delete` commands, etc.).


## v0.21.1
Expand Down
20 changes: 8 additions & 12 deletions cmd/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,10 @@ func adminCreateCommand(app core.App) *cobra.Command {

func adminUpdateCommand(app core.App) *cobra.Command {
command := &cobra.Command{
Use: "update",
Example: "admin update [email protected] 1234567890",
Short: "Changes the password of a single admin account",
// prevents printing the error log twice
SilenceErrors: true,
SilenceUsage: true,
Use: "update",
Example: "admin update [email protected] 1234567890",
Short: "Changes the password of a single admin account",
SilenceUsage: true,
RunE: func(command *cobra.Command, args []string) error {
if len(args) != 2 {
return errors.New("Missing email and password arguments.")
Expand Down Expand Up @@ -111,12 +109,10 @@ func adminUpdateCommand(app core.App) *cobra.Command {

func adminDeleteCommand(app core.App) *cobra.Command {
command := &cobra.Command{
Use: "delete",
Example: "admin delete [email protected]",
Short: "Deletes an existing admin account",
// prevents printing the error log twice
SilenceErrors: true,
SilenceUsage: true,
Use: "delete",
Example: "admin delete [email protected]",
Short: "Deletes an existing admin account",
SilenceUsage: true,
RunE: func(command *cobra.Command, args []string) error {
if len(args) == 0 || args[0] == "" || is.EmailFormat.Validate(args[0]) != nil {
return errors.New("Invalid or missing email address.")
Expand Down

0 comments on commit 722a749

Please sign in to comment.