Skip to content

Commit

Permalink
fix(pkg): if lastRun distro is empty, we don't need to convert it to …
Browse files Browse the repository at this point in the history
…a driverkit distro.

We will need to run on any supported distro.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP committed Aug 31, 2023
1 parent 4b2c593 commit 873412a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,13 @@ func autogenerateConfigs(opts Options) error {
}
slog.Debug("loaded last-distro", "distro", lastDistro)

// Map back the kernel crawler distro to our internal driverkit distro
opts.Distro = root.ToDriverkitDistro(root.KernelCrawlerDistro(lastDistro)).String()
if opts.Distro == "" {
return fmt.Errorf("kernel-crawler last run distro '%s' unsupported.\n", lastDistro)
// If lastDistro is empty it means we need to run on all supported distros; this is done automatically.
if lastDistro != "" {
// Map back the kernel crawler distro to our internal driverkit distro
opts.Distro = root.ToDriverkitDistro(root.KernelCrawlerDistro(lastDistro)).String()
if opts.Distro == "" {
return fmt.Errorf("kernel-crawler last run distro '%s' unsupported.\n", lastDistro)
}
}
}

Expand Down

0 comments on commit 873412a

Please sign in to comment.