From e7faf3d64106d269188fb2a01bb1f113a441666b Mon Sep 17 00:00:00 2001 From: partisan Date: Sun, 29 Dec 2024 08:54:45 +0100 Subject: [PATCH] fixed build directory check --- main.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 3e7d5be..10c819c 100644 --- a/main.go +++ b/main.go @@ -183,12 +183,6 @@ func BuildProcess() { log.Fatalf("Error resolving source path: %v", err) } - // Detect the build directory dynamically - buildDir, err := spitfire.ResolveBuildDir(sourcePath) - if err != nil { - log.Fatalf("Error resolving build directory: %v", err) - } - if all { spitfire.DownloadSource(sourcePath, sourceRepo) spitfire.DiscardChanges(sourcePath) @@ -199,6 +193,11 @@ func BuildProcess() { } spitfire.Configure(sourcePath) spitfire.Build(sourcePath) + // Detect the build directory dynamically + buildDir, err := spitfire.ResolveBuildDir(sourcePath) + if err != nil { + log.Fatalf("Error resolving build directory: %v", err) + } if err := spitfire.ApplyPatches(buildDir, patchesRepo, "post-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { log.Fatalf("Error during patch application: %v", err) } @@ -214,6 +213,11 @@ func BuildProcess() { } spitfire.Configure(sourcePath) spitfire.Build(sourcePath) + // Detect the build directory dynamically + buildDir, err := spitfire.ResolveBuildDir(sourcePath) + if err != nil { + log.Fatalf("Error resolving build directory: %v", err) + } if postPatch { if err := spitfire.ApplyPatches(buildDir, patchesRepo, "post-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { log.Fatalf("Error during patch application: %v", err) @@ -237,6 +241,11 @@ func BuildProcess() { } fmt.Println("Patches updated.") } else if postPatch { + // Detect the build directory dynamically + buildDir, err := spitfire.ResolveBuildDir(sourcePath) + if err != nil { + log.Fatalf("Error resolving build directory: %v", err) + } if _, err := os.Stat(buildDir); err == nil { if err := spitfire.ApplyPatches(buildDir, patchesRepo, "post-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { log.Fatalf("Error during patch application: %v", err)