forked from Plemya-x/ALR
wip
This commit is contained in:
parent
90867f5d7c
commit
ed173867f5
@ -164,7 +164,10 @@ func (d *Decoder) DecodeVars(val any) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type ScriptFunc func(ctx context.Context, opts ...interp.RunnerOption) error
|
type (
|
||||||
|
ScriptFunc func(ctx context.Context, opts ...interp.RunnerOption) error
|
||||||
|
ScriptFuncWithSubshell func(ctx context.Context, opts ...interp.RunnerOption) (*interp.Runner, error)
|
||||||
|
)
|
||||||
|
|
||||||
// GetFunc returns a function corresponding to a bash function
|
// GetFunc returns a function corresponding to a bash function
|
||||||
// with the given name
|
// with the given name
|
||||||
@ -197,10 +200,7 @@ func (d *Decoder) GetFuncP(name string, prepare PrepareFunc) (ScriptFunc, bool)
|
|||||||
}, true
|
}, true
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: replace
|
func (d *Decoder) GetFuncWithSubshell(name string) (ScriptFuncWithSubshell, bool) {
|
||||||
func (d *Decoder) GetFuncSub(name string) (
|
|
||||||
func(ctx context.Context, opts ...interp.RunnerOption) (*interp.Runner, error), bool,
|
|
||||||
) {
|
|
||||||
fn := d.getFunc(name)
|
fn := d.getFunc(name)
|
||||||
if fn == nil {
|
if fn == nil {
|
||||||
return nil, false
|
return nil, false
|
||||||
|
@ -351,7 +351,7 @@ func (b *Builder) executeFirstPass(
|
|||||||
for _, pkgName := range b.opts.Packages {
|
for _, pkgName := range b.opts.Packages {
|
||||||
var preVars types.BuildVarsPre
|
var preVars types.BuildVarsPre
|
||||||
funcName := fmt.Sprintf("meta_%s", pkgName)
|
funcName := fmt.Sprintf("meta_%s", pkgName)
|
||||||
meta, ok := dec.GetFuncSub(funcName)
|
meta, ok := dec.GetFuncWithSubshell(funcName)
|
||||||
if !ok {
|
if !ok {
|
||||||
return "", nil, errors.New("func is missing")
|
return "", nil, errors.New("func is missing")
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,7 @@ func (rs *Repos) updatePkg(ctx context.Context, repo types.Repo, runner *interp.
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
meta, ok := d.GetFuncSub(funcName)
|
meta, ok := d.GetFuncWithSubshell(funcName)
|
||||||
if !ok {
|
if !ok {
|
||||||
return errors.New("func is missing")
|
return errors.New("func is missing")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user