Remove unused function

This commit is contained in:
Elara 2022-12-18 17:59:58 -08:00
parent 22a74aa793
commit c9bc1e7fc3
1 changed files with 0 additions and 41 deletions

View File

@ -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 {