Expose native configuration scopes and independent comparisons
This commit is contained in:
@@ -2,6 +2,7 @@ package cli
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"strconv"
|
||||
|
||||
appconfig "gitea.maximumdirect.net/eric/scriptorium/internal/config"
|
||||
@@ -87,8 +88,22 @@ func loadApplication(ctx context.Context, selection ckconfig.Selection, input ap
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func loadEngine(ctx context.Context, selection ckconfig.Selection, input applicationInput, state struct{}) (*promptkit.Engine, error) {
|
||||
result, err := loadApplication(ctx, selection, input, state)
|
||||
func loadEngine(ctx context.Context, selection ckconfig.Selection, input applicationInput, state *acquisitionState) (*promptkit.Engine, error) {
|
||||
result, err := loadApplication(ctx, selection, input, struct{}{})
|
||||
if state != nil {
|
||||
evidence := applicationAcquisition{err: err}
|
||||
if result != nil {
|
||||
evidence.sources, evidence.records = result.Sources(), result.Diagnostics()
|
||||
}
|
||||
var native *configkit.LoadError
|
||||
if errors.As(err, &native) && native != nil {
|
||||
evidence.sources, evidence.records = native.Sources(), native.Diagnostics()
|
||||
}
|
||||
state.applications = append(state.applications, evidence)
|
||||
if err != nil {
|
||||
return nil, errApplicationAcquisition
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user