Handle an empty BASHBREW_ARCH variable

This commit is contained in:
Tianon Gravi 2021-08-02 17:11:59 -07:00
parent 3ebdb4c18f
commit 6b94cffe46
1 changed files with 5 additions and 0 deletions

View File

@ -168,6 +168,11 @@ func main() {
constraints = c.GlobalStringSlice("constraint")
exclusiveConstraints = c.GlobalBool("exclusive-constraints")
if arch == "" {
// weird edge case... ("BASHBREW_ARCH=")
arch = manifest.DefaultArchitecture
}
var ok bool
if ociArch, ok = architecture.SupportedArches[arch]; !ok {
return fmt.Errorf("invalid architecture: %q", arch)