diff --git a/main.go b/main.go index e23fc49..0a7614c 100644 --- a/main.go +++ b/main.go @@ -186,6 +186,23 @@ func BuildProcess() { spitfire.RunProject(sourcePath) } fmt.Println("Spitfire build completed successfully.") + } else if buildFlag { + if prePatch { + if err := spitfire.ApplyPatches(sourcePath, patchesRepo, "pre-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil { + log.Fatalf("Error during patch application: %v", err) + } + } + spitfire.Configure(sourcePath) + spitfire.Build(sourcePath) + 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) + } + } + if run { + spitfire.RunProject(sourcePath) + } + fmt.Println("Spitfire build completed successfully.") } else if clean { spitfire.CleanBuild(sourcePath) fmt.Println("Cleaned Firefox build.") @@ -205,18 +222,9 @@ func BuildProcess() { log.Fatalf("Error during patch application: %v", err) } } - } else if buildFlag { - spitfire.Configure(sourcePath) - spitfire.Build(sourcePath) - 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) - } - } if run { spitfire.RunProject(sourcePath) } - fmt.Println("Spitfire build completed successfully.") } else if run { spitfire.RunProject(sourcePath) } diff --git a/spitfire/patch.go b/spitfire/patch.go index 4c380a6..8a6f972 100644 --- a/spitfire/patch.go +++ b/spitfire/patch.go @@ -29,7 +29,7 @@ func ApplyPatches(sourcePath string, patchesRepo string, patchesPath string, pat } fmt.Println("Patches repository cloned successfully.") } else { - if skipUpdateRepo { + if !skipUpdateRepo { // If the directory exists, fetch and pull the latest changes fmt.Println("Patches directory already exists. Fetching latest changes.") cmdFetch := exec.Command("git", "fetch", "--all")