func generateFile(experimentDetails types.Experiment, fileName string, templatePath string) error {
	tpl, err := template.ParseFiles(templatePath)
	if err != nil {
		return err
	}
	var out bytes.Buffer
	err = tpl.Execute(&out, experimentDetails)
	if err != nil {
		return err
	}
	err = ioutil.WriteFile(fileName, out.Bytes(), 0644)
	return err
}
generateFile bootstrap the file from the template
package cmd
import (
	"bytes"
	"io/ioutil"
	"os"
	"os/exec"
	"path"
	"path/filepath"
	"strings"
	"text/template"
	"github.com/litmuschaos/litmus-go/contribute/developer-guide/types"
	"github.com/litmuschaos/litmus-go/pkg/log"
	"github.com/pkg/errors"
	"gopkg.in/yaml.v2"
)
func GenerateExperiment(attributeFile, chartType string, generationType string) error {
	var experimentDetails types.Experiment
	if err := getConfig(&experimentDetails, attributeFile); err != nil {
		return err
	}
	currDir, err := os.Getwd()
	if err != nil {
		return err
	}
	currDir = path.Join(currDir, "..")
	litmusRootDir := filepath.Dir(currDir)
	categoryDIR := litmusRootDir + "/experiments/" + experimentDetails.Category
	createDirectoryIfNotPresent(categoryDIR)
	experimentRootDIR := categoryDIR + "/" + experimentDetails.Name
	createDirectoryIfNotPresent(experimentRootDIR)
	switch strings.ToLower(generationType) {
	case "chart":
		if chartType == "category" || chartType == "all" {
			if err := createCategoryCharts(litmusRootDir, experimentRootDIR, experimentDetails); err != nil {
				return err
			}
		}
		if chartType == "experiment" || chartType == "all" {
			if err := createExperimentCharts(litmusRootDir, experimentRootDIR, experimentDetails); err != nil {
				return err
			}
		}
	default:
		if err := createExperiment(experimentRootDIR, experimentDetails); err != nil {
			return err
		}
		if err := createChaosLib(litmusRootDir, experimentDetails); err != nil {
			return err
		}
		if err := createENV(litmusRootDir, experimentDetails); err != nil {
			return err
		}
		if err := createOkteto(experimentRootDIR, experimentDetails); err != nil {
			return err
		}
	}
	return nil
}
func getConfig(experimentDetails *types.Experiment, attributeFile string) error {
	yamlFile, err := ioutil.ReadFile(attributeFile)
	if err != nil {
		return errors.Errorf("Unable to read the yaml file, err: %v", err)
	}
	err = yaml.Unmarshal(yamlFile, experimentDetails)
	if err != nil {
		return errors.Errorf("Unable to unmarshal, err: %v", err)
	}
	return nil
}