From 6a1f7098d7caff6c34485b6ea8dd0876f4ab09d8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 3 Oct 2025 08:54:53 -0500 Subject: init patches file & save the file --- init.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'init.go') 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) + } } } -- cgit v1.2.3