From b095f784487cfacab0ccb4f53fca2e48e2981396 Mon Sep 17 00:00:00 2001 From: Mattias Hansson Date: Thu, 14 May 2026 21:50:30 +0200 Subject: [PATCH] Assembler file is in the current dir not in temp --- main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 1072107..87a4c1d 100644 --- a/main.go +++ b/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) }