Skip to content

Commit

Permalink
🐛 when no dependencies are found do not return an error (#583)
Browse files Browse the repository at this point in the history
Fixes #582

Signed-off-by: Pranav Gaikwad <[email protected]>
  • Loading branch information
pranavgaikwad authored Apr 19, 2024
1 parent 9a39986 commit 20e6323
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions cmd/analyzer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ func DependencyOutput(ctx context.Context, providers map[string]provider.Interna

if depsFlat == nil && depsTree == nil {
errLog.Info("failed to get dependencies from all given providers")
os.Exit(1)
return
}

var b []byte
Expand All @@ -483,7 +483,7 @@ func DependencyOutput(ctx context.Context, providers map[string]provider.Interna
b, err = yaml.Marshal(depsTree)
if err != nil {
errLog.Error(err, "failed to marshal dependency data as yaml")
os.Exit(1)
return
}
} else {
// Sort depsFlat
Expand All @@ -498,14 +498,14 @@ func DependencyOutput(ctx context.Context, providers map[string]provider.Interna
b, err = yaml.Marshal(depsFlat)
if err != nil {
errLog.Error(err, "failed to marshal dependency data as yaml")
os.Exit(1)
return
}
}

err = os.WriteFile(depOutputFile, b, 0644)
if err != nil {
errLog.Error(err, "failed to write dependencies to output file", "file", depOutputFile)
os.Exit(1)
return
}

}
2 changes: 1 addition & 1 deletion cmd/dep/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func DependencyCmd() *cobra.Command {

if depsFlat == nil && depsTree == nil {
errLog.Info("failed to get dependencies from all given providers")
os.Exit(1)
os.Exit(0)
}

var b []byte
Expand Down

0 comments on commit 20e6323

Please sign in to comment.