Skip to content

Commit

Permalink
Update zww_extractor.ts to create the output directory if it does not…
Browse files Browse the repository at this point in the history
… already exist (#710)

Without this change, the script will fail if data/ZeldaWindWaker does not already exist
  • Loading branch information
themikelester authored Oct 18, 2024
1 parent ca86b15 commit 3552e65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ZeldaWindWaker/tools/zww_extractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit 3552e65

Please sign in to comment.