Skip to content

Commit

Permalink
fix: allow ossindexurl override via env var
Browse files Browse the repository at this point in the history
  • Loading branch information
bhamail committed May 24, 2022
1 parent 2696a44 commit 6aa78b7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,17 @@ type ossiServerFactory interface {
type ossiFactory struct{}

func (ossiFactory) create() ossindex.IServer {
// allow override of OSSIndex URL if needed special debug case
ossIndexURL := os.Getenv("OSSIndexURL")
if ossIndexURL != "" {
logLady.Debug("Override OSSIndexURL", ossIndexURL)
}

server := ossindex.New(logLady, ossIndexTypes.Options{
Username: viper.GetString(configuration.ViperKeyUsername),
Token: viper.GetString(configuration.ViperKeyToken),
Tool: "nancy-client",
OSSIndexURL: ossIndexURL,
Version: buildversion.BuildVersion,
DBCachePath: configOssi.DBCachePath,
DBCacheName: "nancy-cache",
Expand Down

0 comments on commit 6aa78b7

Please sign in to comment.