1
0
Fork 0

feat: exit with error if no packages found to download

master
dump_stack() 2023-05-15 13:41:04 +00:00
parent 346e24db6b
commit 97ee8f09a4
Signed by: dump_stack
GPG Key ID: BE44DA8C062D87DC
1 changed files with 7 additions and 0 deletions

View File

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