Added frequencies.go generation

This commit is contained in:
Manuel Carmona
2017-05-25 12:33:26 +02:00
parent a63c8bdf81
commit fcf30a07c8
17 changed files with 258239 additions and 24 deletions

View File

@ -54,7 +54,13 @@ const (
aliasesTmplPath = "internal/code-generator/assets/aliases.go.tmpl"
aliasesTmpl = "aliases.go.tmpl"
commitPath = ".git/refs/heads/master"
// frequencies.go generation
samplesDir = ".linguist/samples"
frequenciesFile = "frequencies.go"
frequenciesTmplPath = "internal/code-generator/assets/frequencies.go.tmpl"
frequenciesTmpl = "frequencies.go.tmpl"
commitPath = ".linguist/.git/refs/heads/master"
)
type generatorArgs struct {
@ -88,6 +94,10 @@ func main() {
log.Println(err)
}
}
if err := generator.Frequencies(samplesDir, frequenciesTmplPath, frequenciesTmpl, commit, frequenciesFile); err != nil {
log.Println(err)
}
}
func getCommit(path string) (string, error) {