fix: ignore empty dependencies

This commit is contained in:
Maxim Slipenko 2024-12-23 21:12:08 +03:00
parent d5636e8094
commit a711edbcc0

@ -47,13 +47,16 @@ func rpmFindDependencies(ctx context.Context, pkgInfo *nfpm.Info, dirs types.Dir
cmd.Stdout = &out cmd.Stdout = &out
cmd.Stderr = &stderr cmd.Stderr = &stderr
if err := cmd.Run(); err != nil { if err := cmd.Run(); err != nil {
log.Error(stderr.String())
return err return err
} }
dependencies := strings.Split(strings.TrimSpace(out.String()), "\n") dependencies := strings.Split(strings.TrimSpace(out.String()), "\n")
for _, dep := range dependencies { for _, dep := range dependencies {
if dep != "" {
updateFunc(dep) updateFunc(dep)
} }
}
return nil return nil
} }