MCPcopy Index your code
hub / github.com/dnote/dnote / Write

Function Write

pkg/cli/config/config.go:80–94  ·  view source on GitHub ↗

Write writes the config to the config file

(ctx context.DnoteCtx, cf Config)

Source from the content-addressed store, hash-verified

78
79// Write writes the config to the config file
80func Write(ctx context.DnoteCtx, cf Config) error {
81 path := GetPath(ctx)
82
83 b, err := yaml.Marshal(cf)
84 if err != nil {
85 return errors.Wrap(err, "marshalling config into YAML")
86 }
87
88 err = os.WriteFile(path, b, 0644)
89 if err != nil {
90 return errors.Wrap(err, "writing the config file")
91 }
92
93 return nil
94}

Callers 3

initConfigFileFunction · 0.92
migrations.goFile · 0.92
generateSchemaFunction · 0.92

Calls 1

GetPathFunction · 0.70

Tested by

no test coverage detected