package tst

import (
	"fmt"

	. "git.eugeniocarvalho.dev/eugeniucarvalho/apicodegen/common"
)

var Build = func(project *Project, buildOptions *BuildOptions) (fn *BuildSet, err error) {
	var (
		before = []*Command{}
	)
	// path := fmt.Sprintf("%s", ts.OutputDir, project.ID)
	outputClientDir := fmt.Sprintf("%s/", project.Client("angular6").OutputDir)

	fn = &BuildSet{
		Before: before,
		After: []*Command{
			{
				Id:          "format_ts",
				Cmd:         fmt.Sprintf("tsfmt -r %s*.ts", outputClientDir),
				Description: "Formata todos os arquivos ts",
			},
		},
	}
	return
}
