Skip to content

Commit 15567cf

Browse files
authored
Merge pull request #28 from snyk/fix/check-org-after-legacy-fallthrough
fix: check org after legacy fallthrough
2 parents 29c7d0e + ec40620 commit 15567cf

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

internal/commands/ostest/ostest.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ func OSWorkflow(
100100

101101
logger.Info().Msg("Getting preferred organization ID")
102102

103-
orgID := config.GetString(configuration.ORGANIZATION)
104-
if orgID == "" {
105-
logger.Error().Msg("No organization ID provided")
106-
return nil, errFactory.NewEmptyOrgError()
107-
}
108-
109103
sbom := config.GetString(flags.FlagSBOM)
110104
sourceDir := config.GetString(flags.FlagSourceDir)
111105
sbomTestReachability := config.GetBool(flags.FlagReachability) && sbom != ""
@@ -145,6 +139,11 @@ func OSWorkflow(
145139
}
146140

147141
// Unified test flow
142+
orgID := config.GetString(configuration.ORGANIZATION)
143+
if orgID == "" {
144+
logger.Error().Msg("No organization ID provided")
145+
return nil, errFactory.NewEmptyOrgError()
146+
}
148147

149148
var riskScorePtr *uint16
150149
if riskScoreThreshold >= math.MaxUint16 {

internal/flags/flags.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ func OSTestFlagSet() *pflag.FlagSet {
106106
flagSet.Bool(FlagFailFast, false, "Stop scanning after the first vulnerability is found when used with --all-projects.")
107107
flagSet.Bool(FlagPrintDeps, false, "Print the dependency tree before sending it for analysis.")
108108
flagSet.Bool(FlagPrintDepPaths, false, "Display dependencies. Shows what files contributed to each dependency.")
109-
flagSet.String(FlagOrg, "", "Specify the <ORG_ID> to run Snyk commands tied to a specific organization.")
110109
flagSet.Bool(FlagIgnorePolicy, false, "Ignore all set policies, the current policy in the .snyk file, Org level ignores, and the project policy on snyk.io.")
111110
flagSet.Bool(FlagTrustPolicies, false, "Apply and use ignore rules from the Snyk policies in your dependencies.")
112111
flagSet.String(FlagShowVulnerablePaths, "", "Display the dependency paths from the top level dependencies down to the vulnerable packages.")

0 commit comments

Comments
 (0)