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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create temporary assembly file
|
// Assembly file sits in current directory for easy inspection
|
||||||
tempDir := os.TempDir()
|
base := strings.TrimSuffix(filepath.Base(inputFile), filepath.Ext(inputFile))
|
||||||
asmFile := filepath.Join(tempDir, "c65gm_"+filepath.Base(inputFile)+".asm")
|
asmFile := base + ".asm"
|
||||||
|
|
||||||
// Compile to assembly
|
// Compile to assembly
|
||||||
if err := compileOnly(inputFile, asmFile); err != nil {
|
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)
|
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 {
|
if !keepAsm {
|
||||||
os.Remove(asmFile)
|
if err := os.Remove(asmFile); err != nil {
|
||||||
|
return fmt.Errorf("failed to remove assembly file: %w", err)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("Intermediate assembly file kept: %s\n", asmFile)
|
fmt.Printf("Intermediate assembly file kept: %s\n", asmFile)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue