Skip to content

Commit

Permalink
fix(strm-2058): do not resolve project if command is auth or create p…
Browse files Browse the repository at this point in the history
…roject (#129)

* fix(strm-2058): do not resolve project if command is auth

* fix(strm-2058): unnecessary whitespace removal

* fix(strm-2058): creating projects is exception for resolving project

Co-authored-by: Bob van den Hoogen <bob@strmprivacy.io>
  • Loading branch information
bobvandenhoogen and Bob van den Hoogen authored Nov 29, 2022
1 parent 537f54d commit 8242ceb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/strm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ func rootCmdPreRun(cmd *cobra.Command, args []string) error {

if auth.Auth.LoadLogin() == nil {
bootstrap.SetupServiceClients(auth.Auth.GetToken())
context.ResolveProject(cmd.Flags())
log.Infoln("Resolved projectId: " + common.ProjectId)
splitCommand := strings.Split(cmd.CommandPath(), " ")
if splitCommand[1] != "auth" && !(splitCommand[1] == "create" && splitCommand[2] == "project") {
context.ResolveProject(cmd.Flags())
log.Infoln("Resolved projectId: " + common.ProjectId)
}
}

return err
Expand Down

0 comments on commit 8242ceb

Please sign in to comment.