Skip to content

Commit

Permalink
feat(config): Read API key from environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
elldritch committed Jan 26, 2018
1 parent 384b13d commit 97626c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/fossa/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,9 @@ func parseConfig(filename string) (*Config, error) {
config.Cli.Locator = project + "$" + revision.Hash().String()
}

if len(config.Cli.APIKey) == 0 {
config.Cli.APIKey = os.Getenv("FOSSA_CLI_API_KEY")
}

return &config, nil
}

0 comments on commit 97626c5

Please sign in to comment.