From bc12130dd6ab747995440e2a2f79bbfd7b6b17bb Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Sun, 21 Jun 2026 22:04:47 -0700 Subject: [PATCH] fix: ensure output dirs exist in extract and API extract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cmdExtract and handleAPIExtract were missing os.MkdirAll calls while cmdDownload, cmdPipeline, and handleAPIDownload all had them. The bash script creates dirs internally but this is not robust — create dirs in Go before shelling out. Closes #13 --- main.go | 2 ++ serve.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/main.go b/main.go index 81a7df7..3f874d9 100644 --- a/main.go +++ b/main.go @@ -391,6 +391,8 @@ func cmdExtract(args []string) { toolPath = findScript("extract_wavs.sh") } + os.MkdirAll(*outDir, 0755) + entries, err := os.ReadDir(*isoDir) if err != nil { fatal("read dir: %v", err) diff --git a/serve.go b/serve.go index 21c88ad..5d0aced 100644 --- a/serve.go +++ b/serve.go @@ -287,6 +287,8 @@ func handleAPIExtract(w http.ResponseWriter, r *http.Request) { outDir = "./wavs" } + os.MkdirAll(outDir, 0755) + toolPath := findScript("extract_wavs.sh") entries, err := os.ReadDir(isoDir)