Skip to content

Commit

Permalink
more gen hacking
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyzimmer committed Nov 2, 2023
1 parent 5330571 commit fbf84d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions cmd/tsutil-gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main

import (
"embed"
"os"
"fmt"
"strings"
"text/template"

Expand Down Expand Up @@ -64,10 +64,14 @@ func main() {
},
},
}
err := t.ExecuteTemplate(os.Stdout, "ts-rpcdb.ts.tmpl", map[string]any{
var buf strings.Builder
err := t.ExecuteTemplate(&buf, "ts-rpcdb.ts.tmpl", map[string]any{
"Spec": &genspec,
})
if err != nil {
panic(err)
}
// Replace all tabs with 2 spaces.
out := strings.ReplaceAll(buf.String(), "\t", " ")
fmt.Println(out)
}
1 change: 0 additions & 1 deletion cmd/tsutil-gen/templates/ts-rpcdb.ts.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,5 @@ export class {{ .Name }}s {
})
});
}

}
{{- end }}

0 comments on commit fbf84d3

Please sign in to comment.