This commit is contained in:
partisan 2025-01-06 22:42:38 +01:00
parent 733af5d582
commit b281505f29

View file

@ -82,8 +82,10 @@ func DiscardChanges(sourcePath string) {
func CleanBuild(sourcePath string, fullClean bool) { func CleanBuild(sourcePath string, fullClean bool) {
fmt.Println("Cleaning build...") fmt.Println("Cleaning build...")
if err := os.Chdir(sourcePath); err != nil { // Resolve the build directory dynamically
errors = append(errors, "Failed to navigate to source directory.") buildDir, err := ResolveBuildDir(sourcePath)
if err != nil {
errors = append(errors, fmt.Sprintf("Failed to resolve build directory: %v", err))
return return
} }
@ -93,8 +95,8 @@ func CleanBuild(sourcePath string, fullClean bool) {
} }
// Paths for CLOBBER file and last build timestamp // Paths for CLOBBER file and last build timestamp
clobberFile := filepath.Join(sourcePath, "obj-x86_64-pc-windows-msvc", "CLOBBER") clobberFile := filepath.Join(buildDir, "CLOBBER")
buildTimestampFile := filepath.Join(sourcePath, "obj-x86_64-pc-windows-msvc", ".last_build_timestamp") buildTimestampFile := filepath.Join(buildDir, ".last_build_timestamp")
// Check if a clobber is required // Check if a clobber is required
clobberRequired := false clobberRequired := false