mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-20 03:27:02 -07:00
Minor changes
This commit is contained in:
parent
962cf42e79
commit
c81ef3b431
4 changed files with 11 additions and 5 deletions
|
|
@ -113,15 +113,15 @@ func RunTargets(config *configurator.Config, targets ...string) {
|
||||||
// write multiple files in directory using template name
|
// write multiple files in directory using template name
|
||||||
err := os.MkdirAll(filepath.Clean(outputPath), 0o755)
|
err := os.MkdirAll(filepath.Clean(outputPath), 0o755)
|
||||||
if err != nil {
|
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)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
for path, contents := range outputBytes {
|
for path, contents := range outputBytes {
|
||||||
filename := filepath.Base(path)
|
filename := filepath.Base(path)
|
||||||
cleanPath := fmt.Sprintf("%s/%s", filepath.Clean(outputPath), filename)
|
cleanPath := fmt.Sprintf("%s/%s", filepath.Clean(outputPath), filename)
|
||||||
err := os.WriteFile(cleanPath, contents, 0o644)
|
err := os.WriteFile(cleanPath, contents, 0o755)
|
||||||
if err != nil {
|
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)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
fmt.Printf("wrote file to '%s'\n", cleanPath)
|
fmt.Printf("wrote file to '%s'\n", cleanPath)
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ func LoadFiles(paths ...string) (Files, error) {
|
||||||
for _, path := range paths {
|
for _, path := range paths {
|
||||||
expandedPaths, err := filepath.Glob(path)
|
expandedPaths, err := filepath.Glob(path)
|
||||||
if err != nil {
|
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 {
|
for _, expandedPath := range expandedPaths {
|
||||||
info, err := os.Stat(expandedPath)
|
info, err := os.Stat(expandedPath)
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,5 @@ func CopyIf[T comparable](s []T, condition func(t T) bool) []T {
|
||||||
f = append(f, e)
|
f = append(f, e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
|
||||||
7
templates/dnsmasq.jinja
Normal file
7
templates/dnsmasq.jinja
Normal 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 }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue