Skip to content

Commit

Permalink
If project flag provided with empty value, act like there is no proje…
Browse files Browse the repository at this point in the history
…ct (#22)
  • Loading branch information
yahavi authored Feb 15, 2024
1 parent 5ca5e63 commit 6cef0a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cli/scancommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ func validateXrayContext(c *components.Context, serverDetails *coreConfig.Server
}

func isProjectProvided(c *components.Context) bool {
return c.GetStringFlagValue(flags.Project) != "" || os.Getenv(coreutils.Project) != ""
if c.IsFlagSet(flags.Project) {
return c.GetStringFlagValue(flags.Project) != ""
}
return os.Getenv(coreutils.Project) != ""
}

func addTrailingSlashToRepoPathIfNeeded(c *components.Context) string {
Expand Down

0 comments on commit 6cef0a1

Please sign in to comment.