diff options
| author | Jeff Carr <[email protected]> | 2025-09-05 07:10:02 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-05 12:54:27 -0500 |
| commit | 2015f84fb4a11f83452117cfb607e47c1d0c251e (patch) | |
| tree | 8f5a99b019988d88973d3f17ee0e770e258608dc /patchset.config.go | |
| parent | 822fe38eee03193930dab310c6dba75a1bc1d6aa (diff) | |
add http headers to protobuf
Diffstat (limited to 'patchset.config.go')
| -rw-r--r-- | patchset.config.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/patchset.config.go b/patchset.config.go index 4f8eedf..6627141 100644 --- a/patchset.config.go +++ b/patchset.config.go @@ -32,6 +32,19 @@ func (f *Forge) LoadPatchsets() error { return nil } +func (f *Forge) InitPatchsets() error { + if err := f.LoadPatchsets(); err == nil { + return nil + } else { + log.Info("LoadPatchsets() failed", err) + } + // TODO: check if Unmarshal failed here + f.Patchsets = NewPatchsets() + tmp := f.findAutoPatchset() // makes the default setting + f.Patchsets.Append(tmp) + return f.SavePatchsets() +} + func (f *Forge) SavePatchsets() error { filename := filepath.Join(f.patchDir, "all-patches.pb") regfile, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0666) |
