Now generates mime file

This commit is contained in:
David Paz
2017-07-10 12:50:52 +02:00
parent 5df52d50a6
commit 125c802582
4 changed files with 13 additions and 2 deletions

View File

@ -8,6 +8,7 @@ type languageInfo struct {
Extensions []string `yaml:"extensions,omitempty,flow"`
Interpreters []string `yaml:"interpreters,omitempty,flow"`
Filenames []string `yaml:"filenames,omitempty,flow"`
MimeType string `yaml:"codemirror_mime_type,omitempty,flow"`
}
func getAlphabeticalOrderedKeys(languages map[string]*languageInfo) []string {

View File

@ -67,6 +67,11 @@ const (
commitTmplPath = "internal/code-generator/assets/commit.go.tmpl"
commitTmpl = "commit.go.tmpl"
// mime.go generation
mimeFile = "data/mime.go"
mimeTmplPath = "internal/code-generator/assets/mime.go.tmpl"
mimeTmpl = "mime.go.tmpl"
commitPath = ".linguist/.git/HEAD"
)
@ -97,6 +102,7 @@ func main() {
&generatorFiles{generator.Aliases, languagesYAML, "", aliasesFile, aliasesTmplPath, aliasesTmpl, commit},
&generatorFiles{generator.Frequencies, "", samplesDir, frequenciesFile, frequenciesTmplPath, frequenciesTmpl, commit},
&generatorFiles{generator.Commit, "", "", commitFile, commitTmplPath, commitTmpl, commit},
&generatorFiles{generator.Mime, languagesYAML, "", mimeFile, mimeTmplPath, mimeTmpl, commit},
}
for _, file := range fileList {