1
0

feat: exit with error if no packages found to download

This commit is contained in:
dump_stack() 2023-05-15 13:41:04 +00:00
parent 346e24db6b
commit 97ee8f09a4
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC

View File

@ -83,6 +83,8 @@ func (cmd DebianGetDebCmd) Run() (err error) {
} }
defer os.RemoveAll(tmp) defer os.RemoveAll(tmp)
hasresults := false
for _, pkg := range packages { for _, pkg := range packages {
if cmd.IgnoreCached { if cmd.IgnoreCached {
log.Debug().Msgf("check cache for %s", pkg.Deb.Name) log.Debug().Msgf("check cache for %s", pkg.Deb.Name)
@ -112,7 +114,12 @@ func (cmd DebianGetDebCmd) Run() (err error) {
if err != nil { if err != nil {
log.Fatal().Err(err).Msg("mv") log.Fatal().Err(err).Msg("mv")
} }
hasresults = true
} }
if !hasresults {
log.Fatal("no packages found to download")
}
return return
} }