From 3552e65e508b735d5d0a685e674e0a64b6ffbc0b Mon Sep 17 00:00:00 2001 From: Mike Lester Date: Thu, 17 Oct 2024 22:32:46 -0600 Subject: [PATCH] Update zww_extractor.ts to create the output directory if it does not already exist (#710) Without this change, the script will fail if data/ZeldaWindWaker does not already exist --- src/ZeldaWindWaker/tools/zww_extractor.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ZeldaWindWaker/tools/zww_extractor.ts b/src/ZeldaWindWaker/tools/zww_extractor.ts index 379a982e4..6e698bc9c 100644 --- a/src/ZeldaWindWaker/tools/zww_extractor.ts +++ b/src/ZeldaWindWaker/tools/zww_extractor.ts @@ -3,7 +3,7 @@ import ArrayBufferSlice from "../../ArrayBufferSlice.js"; import * as BYML from "../../byml.js"; import * as Yaz0 from '../../Common/Compression/Yaz0.js'; import * as JKRArchive from "../../Common/JSYSTEM/JKRArchive.js"; -import { openSync, readSync, closeSync, readFileSync, writeFileSync, readdirSync } from "fs"; +import { openSync, readSync, closeSync, readFileSync, writeFileSync, readdirSync, mkdirSync } from "fs"; import { assertExists, hexzero, assert, readString } from "../../util.js"; import { Endianness } from "../../endian.js"; import { loadRustLib } from "../../rustlib.js"; @@ -332,6 +332,7 @@ function extractExtra(binaries: Binary[]) { }; const data = BYML.write(crg1, BYML.FileType.CRG1); + mkdirSync(pathBaseOut, { recursive: true }); writeFileSync(`${pathBaseOut}/extra.crg1_arc`, Buffer.from(data)); }