Skip to content

Commit

Permalink
fix(cmd): move validation to upload cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
xizhao committed Jan 30, 2018
1 parent b0d5c7a commit 79b5b64
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cmd/fossa/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,6 @@ func BootstrapCmd(c *cli.Context) error {
config.CLI.APIKey = apiKeyFlag
}

if config.CLI.Locator == "" {
log.Logger.Fatal("no revision found in working directory; try running in a git repo or passing a locator")
}

if config.CLI.Project == "" {
log.Logger.Fatal("could not infer project name from either `.fossa.yaml` or `git` remote named `origin`")
}

log.Logger.Debugf("Configuration: %+v\n", config)

context.config = config
Expand Down Expand Up @@ -317,6 +309,14 @@ func doUpload(config Config, modules []*build.Module) error {
return errors.New("invalid FOSSA endpoint")
}

if config.CLI.Locator == "" {
log.Logger.Fatal("no revision found in working directory; try running in a git repo or passing a locator")
}

if config.CLI.Project == "" {
log.Logger.Fatal("could not infer project name from either `.fossa.yaml` or `git` remote named `origin`")
}

log.Logger.Debugf("Uploading build data from (%s) modules:", len(modules))

// re-marshall into build data
Expand Down

0 comments on commit 79b5b64

Please sign in to comment.