Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
feat: color code response for easy spotting
Browse files Browse the repository at this point in the history
  • Loading branch information
mainawycliffe committed Dec 10, 2019
1 parent 13c536b commit 590ccb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
13 changes: 5 additions & 8 deletions cmd/deleteUser.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"os"

"github.com/logrusorgru/aurora"
"github.com/mainawycliffe/kamanda/firebase/auth"
"github.com/spf13/cobra"
)
Expand All @@ -20,19 +21,15 @@ var deleteUserCmd = &cobra.Command{
fmt.Printf("atleast one Firebase user uid is required!")
os.Exit(1)
}

// delete all user accounts
// delete all listed user accounts
for _, uid := range args {

err := auth.DeleteFirebaseUser(context.Background(), uid)

if err != nil {
fmt.Printf("Error deleting %s: %s\n", uid, err.Error())
os.Exit(1)
fmt.Print(aurora.Sprintf(aurora.Red("%s - Not Deleted: %s\n"), uid, err.Error()))
continue
}
fmt.Print(aurora.Sprintf(aurora.Green("%s - Deleted\n"), uid))
}

fmt.Printf("User was successfully deleted!")
os.Exit(0)
},
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/go-chi/chi v4.0.2+incompatible
github.com/golang/groupcache v0.0.0-20191027212112-611e8accdfc9 // indirect
github.com/joho/godotenv v1.3.0
github.com/logrusorgru/aurora v0.0.0-20191116043053-66b7ad493a23
github.com/mitchellh/go-homedir v1.1.0
github.com/pelletier/go-toml v1.6.0 // indirect
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/logrusorgru/aurora v0.0.0-20191116043053-66b7ad493a23 h1:Wp7NjqGKGN9te9N/rvXYRhlVcrulGdxnz8zadXWs7fc=
github.com/logrusorgru/aurora v0.0.0-20191116043053-66b7ad493a23/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
Expand Down

0 comments on commit 590ccb4

Please sign in to comment.