mirror of
https://github.com/StackExchange/dnscontrol.git
synced 2024-05-11 05:55:12 +00:00
Embed types-dnscontrol.d.ts into the binary instead of fetching it via HTTP (#1942)
Co-authored-by: Tom Limoncelli <tlimoncelli@stackoverflow.com>
This commit is contained in:
@@ -16,13 +16,13 @@ func generateDTSFile(funcs string) error {
|
||||
"// WARNING: These type definitions are experimental and subject to change in future releases.",
|
||||
}
|
||||
for _, name := range names {
|
||||
content, err := os.ReadFile(join("types", "src", name+".d.ts"))
|
||||
content, err := os.ReadFile(join("commands", "types", name+".d.ts"))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
combined = append(combined, string(content))
|
||||
}
|
||||
combined = append(combined, funcs)
|
||||
os.WriteFile(join("types", "dnscontrol.d.ts"), []byte(strings.Join(combined, "\n\n")), 0644)
|
||||
os.WriteFile(join("commands", "types", "dnscontrol.d.ts"), []byte(strings.Join(combined, "\n\n")), 0644)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user