@@ -13,7 +13,7 @@ import (
1313 "runtime"
1414)
1515
16- const VERSION = "v0.2.1 "
16+ const VERSION = "v0.2.2 "
1717
1818func main () {
1919 configFileName := flag .String ("config" , "recodegen.json" , "Configuration file name" )
@@ -58,14 +58,16 @@ func main() {
5858
5959func processInput (schemaAst * ast.Schema , outputFileName string , genConfig config.CodegenSchemaEntryConfig ) {
6060 output := ""
61+ hadKnownPlugin := false
6162 for _ , plugin := range genConfig .Plugins {
6263 if plugin == "typescript" {
63- //generateSchema(schemaAst, outputFileName)
64+ hadKnownPlugin = true
6465 schema := typescript.Schema {Ast : schemaAst }
6566 output += schema .String ()
6667 }
6768
6869 if plugin == "typescript-operations" {
70+ hadKnownPlugin = true
6971 operation := typescript.Operations {
7072 Ast : schemaAst ,
7173 Config : genConfig ,
@@ -75,6 +77,12 @@ func processInput(schemaAst *ast.Schema, outputFileName string, genConfig config
7577 }
7678 }
7779
80+ // don't write anything to a file if no known plugins were used
81+ if ! hadKnownPlugin {
82+ fmt .Printf ("[skipping] %s\n " , outputFileName )
83+ return
84+ }
85+
7886 existingFileContent := getFileContentIfExists (outputFileName )
7987 if * existingFileContent != output {
8088 fmt .Printf ("[writing] %s\n " , outputFileName )
0 commit comments