<commit_before>package custom

import (
	"path/filepath"

	"github.com/hashicorp/otto/helper/compile"
	"github.com/hashicorp/otto/helper/schema"
)

type customizations struct {
	Opts *compile.AppOptions
}

func (c *customizations) processBuild(d *schema.FieldData) error {
	p, ok := d.GetOk("packer")
	if !ok {
		return nil
	}

	c.Opts.Bindata.Context["build_packer_path"] = p.(string)
	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomBuild(d))
	return nil
}

func (c *customizations) processDeploy(d *schema.FieldData) error {
	tf, ok := d.GetOk("terraform")
	if !ok {
		return nil
	}

	c.Opts.Bindata.Context["deploy_terraform_path"] = tf.(string)
	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDeploy(d))
	return nil
}

func (c *customizations) processDev(d *schema.FieldData) error {
	p, ok := d.GetOk("vagrant")
	if !ok {
		return nil
	}

	c.Opts.Bindata.Context["dev_vagrant_path"] = p.(string)
	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDev(d))
	return nil
}

func (c *customizations) processDevDep(d *schema.FieldData) error {
	if _, ok := d.GetOk("vagrantfile"); !ok {
		return nil
	}

	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDevDep(d))
	return nil
}

func (c *customizations) compileCustomBuild(d *schema.FieldData) compile.CompileCallback {
	return func() error {
		return c.Opts.Bindata.RenderAsset(
			filepath.Join(c.Opts.Ctx.Dir, "build", "packer_path"),
			"data/sentinels/packer_path.tpl")
	}
}

func (c *customizations) compileCustomDeploy(d *schema.FieldData) compile.CompileCallback {
	return func() error {<commit_msg>Check for correct Vagrantfile field in custom type<commit_after>package custom

import (
	"path/filepath"

	"github.com/hashicorp/otto/helper/compile"
	"github.com/hashicorp/otto/helper/schema"
)

type customizations struct {
	Opts *compile.AppOptions
}

func (c *customizations) processBuild(d *schema.FieldData) error {
	p, ok := d.GetOk("packer")
	if !ok {
		return nil
	}

	c.Opts.Bindata.Context["build_packer_path"] = p.(string)
	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomBuild(d))
	return nil
}

func (c *customizations) processDeploy(d *schema.FieldData) error {
	tf, ok := d.GetOk("terraform")
	if !ok {
		return nil
	}

	c.Opts.Bindata.Context["deploy_terraform_path"] = tf.(string)
	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDeploy(d))
	return nil
}

func (c *customizations) processDev(d *schema.FieldData) error {
	p, ok := d.GetOk("vagrantfile")

	if !ok {
		return nil
	}

	c.Opts.Bindata.Context["dev_vagrant_path"] = p.(string)
	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDev(d))
	return nil
}

func (c *customizations) processDevDep(d *schema.FieldData) error {
	if _, ok := d.GetOk("vagrantfile"); !ok {
		return nil
	}

	c.Opts.Callbacks = append(c.Opts.Callbacks, c.compileCustomDevDep(d))
	return nil
}

func (c *customizations) compileCustomBuild(d *schema.FieldData) compile.CompileCallback {
	return func() error {
		return c.Opts.Bindata.RenderAsset(
			filepath.Join(c.Opts.Ctx.Dir, "build", "packer_path"),
			"data/sentinels/packer_path.tpl")
	}
}

func (c *customizations) compileCustomDeploy(d *schema.FieldData) compile.CompileCallback {
	return func() error {
{'fraction_non_alphanumeric': 0.14373843306600864, 'fraction_numerical': 0.0, 'mean_word_length': 4.8432432432432435, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3728032', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1231, 'n_words': 231}