func writeConfig()

in pkg/ecctl/init.go [343:354]


func writeConfig(cfg Config, filePath, ext string) error {
	configBytes, err := json.MarshalIndent(cfg, "", "  ")
	if err != nil {
		return err
	}

	if !strings.HasSuffix(filePath, ext) {
		filePath += ext
	}

	return os.WriteFile(filePath, configBytes, 0666)
}