summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-03 08:54:53 -0500
committerJeff Carr <[email protected]>2025-10-03 08:54:53 -0500
commit6a1f7098d7caff6c34485b6ea8dd0876f4ab09d8 (patch)
tree5b005c9bf3b69568fc63baa8db93bd15b4d2f287
parentac08950abc98ada7e906b19cf48a64c021d52524 (diff)
init patches file & save the file
-rw-r--r--init.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/init.go b/init.go
index b09d246..a36875d 100644
--- a/init.go
+++ b/init.go
@@ -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)
+ }
}
}