diff --git a/cmd_publish.go b/cmd_publish.go index 47ef2f3f..3ba7aec7 100644 --- a/cmd_publish.go +++ b/cmd_publish.go @@ -81,7 +81,9 @@ func aptlyPublishSnapshot(cmd *commander.Command, args []string) error { if distribution == "" { if sourceRepo != nil { distribution = sourceRepo.Distribution - } else { + } + + if distribution == "" { return fmt.Errorf("unable to guess distribution name, please specify explicitly") } }