Minor changes

This commit is contained in:
David Allen 2024-07-03 10:00:49 -06:00
parent 962cf42e79
commit c81ef3b431
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
4 changed files with 11 additions and 5 deletions

View file

@ -113,15 +113,15 @@ func RunTargets(config *configurator.Config, targets ...string) {
// write multiple files in directory using template name
err := os.MkdirAll(filepath.Clean(outputPath), 0o755)
if err != nil {
fmt.Printf("failed to make output directory: %v", err)
fmt.Printf("failed to make output directory: %v\n", err)
os.Exit(1)
}
for path, contents := range outputBytes {
filename := filepath.Base(path)
cleanPath := fmt.Sprintf("%s/%s", filepath.Clean(outputPath), filename)
err := os.WriteFile(cleanPath, contents, 0o644)
err := os.WriteFile(cleanPath, contents, 0o755)
if err != nil {
fmt.Printf("failed to write config to file: %v", err)
fmt.Printf("failed to write config to file: %v\n", err)
os.Exit(1)
}
fmt.Printf("wrote file to '%s'\n", cleanPath)

View file

@ -169,7 +169,7 @@ func LoadFiles(paths ...string) (Files, error) {
for _, path := range paths {
expandedPaths, err := filepath.Glob(path)
if err != nil {
return nil, fmt.Errorf("failed to expand path: %v", err)
return nil, fmt.Errorf("failed to glob path: %v", err)
}
for _, expandedPath := range expandedPaths {
info, err := os.Stat(expandedPath)

View file

@ -76,6 +76,5 @@ func CopyIf[T comparable](s []T, condition func(t T) bool) []T {
f = append(f, e)
}
}
return f
}

7
templates/dnsmasq.jinja Normal file
View file

@ -0,0 +1,7 @@
#
# This file was auto-generated by the OpenCHAMI "configurator" tool using the "{{name}}" plugin.
#
# Source code: https://github.com/OpenCHAMI/configurator
# Creating plugins: https://github.com/OpenCHAMI/configurator/blob/main/README.md#creating-generator-plugins
#
{{ output }}