MCPcopy
hub / github.com/opencloud-eu/opencloud / writeConfig

Function writeConfig

opencloud/pkg/init/functions.go:74–84  ·  view source on GitHub ↗

writeConfig writes the config to the target path and prints a banner

(configPath, ocAdminServicePassword, targetBackupConfig string, yamlOutput []byte, adminPWgenerated, quiet bool)

Source from the content-addressed store, hash-verified

72
73// writeConfig writes the config to the target path and prints a banner
74func writeConfig(configPath, ocAdminServicePassword, targetBackupConfig string, yamlOutput []byte, adminPWgenerated, quiet bool) error {
75 targetPath := path.Join(configPath, configFilename)
76 err := os.WriteFile(targetPath, yamlOutput, 0600)
77 if err != nil {
78 return err
79 }
80 if !quiet {
81 printBanner(targetPath, ocAdminServicePassword, adminPWgenerated, targetBackupConfig)
82 }
83 return nil
84}
85
86// writePatch writes the diff to a file
87func writePatch(configPath string, yamlOutput []byte) error {

Callers 1

CreateConfigFunction · 0.85

Calls 1

printBannerFunction · 0.85

Tested by

no test coverage detected