fixed build directory check
This commit is contained in:
parent
b876df0d83
commit
e7faf3d641
1 changed files with 15 additions and 6 deletions
21
main.go
21
main.go
|
@ -183,12 +183,6 @@ func BuildProcess() {
|
||||||
log.Fatalf("Error resolving source path: %v", err)
|
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 {
|
if all {
|
||||||
spitfire.DownloadSource(sourcePath, sourceRepo)
|
spitfire.DownloadSource(sourcePath, sourceRepo)
|
||||||
spitfire.DiscardChanges(sourcePath)
|
spitfire.DiscardChanges(sourcePath)
|
||||||
|
@ -199,6 +193,11 @@ func BuildProcess() {
|
||||||
}
|
}
|
||||||
spitfire.Configure(sourcePath)
|
spitfire.Configure(sourcePath)
|
||||||
spitfire.Build(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 {
|
if err := spitfire.ApplyPatches(buildDir, patchesRepo, "post-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); err != nil {
|
||||||
log.Fatalf("Error during patch application: %v", err)
|
log.Fatalf("Error during patch application: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -214,6 +213,11 @@ func BuildProcess() {
|
||||||
}
|
}
|
||||||
spitfire.Configure(sourcePath)
|
spitfire.Configure(sourcePath)
|
||||||
spitfire.Build(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 postPatch {
|
||||||
if err := spitfire.ApplyPatches(buildDir, patchesRepo, "post-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); 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)
|
log.Fatalf("Error during patch application: %v", err)
|
||||||
|
@ -237,6 +241,11 @@ func BuildProcess() {
|
||||||
}
|
}
|
||||||
fmt.Println("Patches updated.")
|
fmt.Println("Patches updated.")
|
||||||
} else if postPatch {
|
} 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 := os.Stat(buildDir); err == nil {
|
||||||
if err := spitfire.ApplyPatches(buildDir, patchesRepo, "post-compile-patches", filepath.Join(sourcePath, "patcher"), skipPatchUpdate); 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)
|
log.Fatalf("Error during patch application: %v", err)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue