Fixed output path file name with multiple targets

This commit is contained in:
David Allen 2024-06-26 14:20:52 -06:00
parent 251088088f
commit 87f35eef0f
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC

View file

@ -109,7 +109,7 @@ var generateCmd = &cobra.Command{
// write multiple files in directory using template name
for _, contents := range outputBytes {
// FIXME: fix output paths to not overwrite each other with multiple templates
err := os.WriteFile(fmt.Sprintf("%s/%s.%s", filepath.Clean(outputPath), target, ".conf"), contents, 0o644)
err := os.WriteFile(fmt.Sprintf("%s/%s.%s", filepath.Clean(outputPath), target, "conf"), contents, 0o644)
if err != nil {
fmt.Printf("failed to write config to file: %v", err)
os.Exit(1)