all: add -work flag

This flag has the same behavior as in upstream Go. It can be useful
while debugging certain issues.
This commit is contained in:
Ayke van Laethem
2022-02-16 18:38:03 +01:00
committed by Ron Evans
parent e9d9ae8781
commit 5746154cc0
3 changed files with 8 additions and 1 deletions
+5 -1
View File
@@ -99,7 +99,11 @@ func Build(pkgName, outpath string, config *compileopts.Config, action func(Buil
if err != nil {
return err
}
defer os.RemoveAll(dir)
if config.Options.Work {
fmt.Printf("WORK=%s\n", dir)
} else {
defer os.RemoveAll(dir)
}
// Check for a libc dependency.
// As a side effect, this also creates the headers for the given libc, if