refactor: merge guess with when no kernels defined
This commit is contained in:
parent
ceaacade0b
commit
2c2124bdb0
22
pew.go
22
pew.go
@ -90,9 +90,8 @@ func (cmd *PewCmd) Run(g *Globals) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
if len(ka.Targets) == 0 {
|
||||
log.Debug().Msg("no targets defined in .out-of-tree.toml, " +
|
||||
"will use all available")
|
||||
if len(ka.Targets) == 0 || cmd.Guess {
|
||||
log.Debug().Msg("will use all available targets")
|
||||
|
||||
for _, dist := range distro.List() {
|
||||
ka.Targets = append(ka.Targets, config.Target{
|
||||
@ -118,13 +117,6 @@ func (cmd *PewCmd) Run(g *Globals) (err error) {
|
||||
ka.Targets = []config.Target{km}
|
||||
}
|
||||
|
||||
if cmd.Guess {
|
||||
ka.Targets, err = genAllKernels()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if cmd.QemuTimeout != 0 {
|
||||
log.Info().Msgf("Set qemu timeout to %s", cmd.QemuTimeout)
|
||||
} else {
|
||||
@ -866,13 +858,3 @@ func kernelMask(kernel string) (km config.Target, err error) {
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func genAllKernels() (sk []config.Target, err error) {
|
||||
for _, id := range distro.IDs {
|
||||
sk = append(sk, config.Target{
|
||||
Distro: distro.Distro{ID: id},
|
||||
Kernel: config.Kernel{Regex: ".*"},
|
||||
})
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user