summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
+ }
}
}