commit
835ac9eef3
@ -57,10 +57,20 @@ func Build(sources map[string]fs.FS, args ...string) (*Value, error) {
|
|||||||
if len(instances) != 1 {
|
if len(instances) != 1 {
|
||||||
return nil, errors.New("only one package is supported at a time")
|
return nil, errors.New("only one package is supported at a time")
|
||||||
}
|
}
|
||||||
|
for _, value := range instances {
|
||||||
|
if value.Err != nil {
|
||||||
|
return nil, value.Err
|
||||||
|
}
|
||||||
|
}
|
||||||
v, err := c.Context.BuildInstances(instances)
|
v, err := c.Context.BuildInstances(instances)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{}))
|
return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{}))
|
||||||
}
|
}
|
||||||
|
for _, value := range v {
|
||||||
|
if value.Err() != nil {
|
||||||
|
return nil, value.Err()
|
||||||
|
}
|
||||||
|
}
|
||||||
if len(v) != 1 {
|
if len(v) != 1 {
|
||||||
return nil, errors.New("internal: wrong number of values")
|
return nil, errors.New("internal: wrong number of values")
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user