Assembler file is in the current dir not in temp
This commit is contained in:
parent
411106ea36
commit
b095f78448
1 changed files with 7 additions and 5 deletions
12
main.go
12
main.go
|
|
@ -298,9 +298,9 @@ func build(inputFile, outputFile string, keepAsm, noCBM bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Create temporary assembly file
|
||||
tempDir := os.TempDir()
|
||||
asmFile := filepath.Join(tempDir, "c65gm_"+filepath.Base(inputFile)+".asm")
|
||||
// Assembly file sits in current directory for easy inspection
|
||||
base := strings.TrimSuffix(filepath.Base(inputFile), filepath.Ext(inputFile))
|
||||
asmFile := base + ".asm"
|
||||
|
||||
// Compile to assembly
|
||||
if err := compileOnly(inputFile, asmFile); err != nil {
|
||||
|
|
@ -312,9 +312,11 @@ func build(inputFile, outputFile string, keepAsm, noCBM bool) error {
|
|||
return fmt.Errorf("assembly failed: %w", err)
|
||||
}
|
||||
|
||||
// Clean up temporary assembly file unless requested to keep it
|
||||
// Remove assembly file unless requested to keep it
|
||||
if !keepAsm {
|
||||
os.Remove(asmFile)
|
||||
if err := os.Remove(asmFile); err != nil {
|
||||
return fmt.Errorf("failed to remove assembly file: %w", err)
|
||||
}
|
||||
} else {
|
||||
fmt.Printf("Intermediate assembly file kept: %s\n", asmFile)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue