Skip to content

Commit

Permalink
Add error handling when no package is built when using build-deps-on …
Browse files Browse the repository at this point in the history
…option
  • Loading branch information
mikusaq committed Jan 29, 2025
1 parent ec3d2d8 commit 5604a74
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion bap-builder/PackageMode.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ func prepareConfigsBuildDepsOrBuildDepsOn(
if err != nil {
return []*bringauto_config.Config{}, err
}
if len(paths) == 0 {
logger := bringauto_log.GetLogger()
logger.Warn("No package depends on %s", packageName)
}
packageJsonPaths = append(packageJsonPaths, paths...)
}
return prepareConfigs(packageJsonPaths)
Expand Down Expand Up @@ -399,7 +403,9 @@ func buildSinglePackage(
if err != nil {
return err
}

if len(configList) == 0 {
return fmt.Errorf("nothing to build")
}
for _, config := range configList {
buildConfigs := config.GetBuildStructure(*cmdLine.DockerImageName, platformString)
err = buildAndCopyPackage(cmdLine, &buildConfigs, platformString, repo)
Expand Down

0 comments on commit 5604a74

Please sign in to comment.