Remove unused function
This commit is contained in:
parent
842c88701f
commit
5809937eba
41
build.go
41
build.go
|
@ -609,47 +609,6 @@ func setScripts(vars *BuildVars, info *nfpm.Info, scriptDir string) {
|
|||
}
|
||||
}
|
||||
|
||||
// getBuildVars only gets the build variables, while disabling exec, stat, open, and readdir
|
||||
func getBuildVars(ctx context.Context, script string, info *distro.OSRelease) (*BuildVars, error) {
|
||||
fl, err := os.Open(script)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
file, err := syntax.NewParser().Parse(fl, "lure.sh")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
fl.Close()
|
||||
|
||||
runner, err := interp.New(
|
||||
interp.Env(expand.ListEnviron()),
|
||||
interp.ExecHandler(shutils.NopExec),
|
||||
interp.StatHandler(shutils.NopStat),
|
||||
interp.OpenHandler(shutils.NopOpen),
|
||||
interp.ReadDirHandler(shutils.NopReadDir),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = runner.Run(ctx, file)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
dec := decoder.New(info, runner)
|
||||
|
||||
var vars BuildVars
|
||||
err = dec.DecodeVars(&vars)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &vars, nil
|
||||
}
|
||||
|
||||
// archMatches checks if your system architecture matches
|
||||
// one of the provided architectures
|
||||
func archMatches(architectures []string) bool {
|
||||
|
|
Loading…
Reference in New Issue