added post compile patch
This commit is contained in:
parent
bb6e62e569
commit
ef936f3aab
3 changed files with 49 additions and 34 deletions
25
spitfire/resolvebuilddir.go
Normal file
25
spitfire/resolvebuilddir.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package spitfire
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// ResolveBuildDir detects the build directory dynamically
|
||||
func ResolveBuildDir(sourcePath string) (string, error) {
|
||||
// The expected build directory pattern
|
||||
globPattern := filepath.Join(sourcePath, "obj-*")
|
||||
|
||||
// Find matching directories
|
||||
matches, err := filepath.Glob(globPattern)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("error resolving build directory: %v", err)
|
||||
}
|
||||
if len(matches) == 0 {
|
||||
return "", fmt.Errorf("build directory not found under %s", sourcePath)
|
||||
}
|
||||
full := filepath.Join(matches[0], "dist", "bin")
|
||||
|
||||
// Return the first match (assumes one build directory exists)
|
||||
return full, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue