diff options
| author | Jeff Carr <[email protected]> | 2025-10-03 08:54:53 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-03 08:54:53 -0500 |
| commit | 6a1f7098d7caff6c34485b6ea8dd0876f4ab09d8 (patch) | |
| tree | 5b005c9bf3b69568fc63baa8db93bd15b4d2f287 | |
| parent | ac08950abc98ada7e906b19cf48a64c021d52524 (diff) | |
init patches file & save the file
| -rw-r--r-- | init.go | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -3,6 +3,7 @@ package forgepb import ( + "errors" "os" "path/filepath" @@ -74,7 +75,12 @@ func initFromConfig(cfg *ForgeConfigs) *Forge { // save patchsets here? } else { if err := config.LoadFile(f.Patchsets, f.Config.PatchPB); err != nil { - log.Info("forge.Init() load patches failed", err) + if errors.Is(err, os.ErrNotExist) { + log.Info("forge.Init() making new patches file", f.Config.PatchPB) + f.SavePatchsets() + } else { + log.Info("forge.Init() load patches failed", err) + } } } |
