wip
This commit is contained in:
parent
cc89f0c75c
commit
afd28d934e
26 changed files with 2103 additions and 427 deletions
20
data-pipeline/utils/create-output-dirs.ts
Normal file
20
data-pipeline/utils/create-output-dirs.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import fs from "fs";
|
||||
import type { Wordlist } from "./scanning-source-files.js";
|
||||
|
||||
/**
|
||||
* Takes a list of scanned datasets and creates their output folders if missing.
|
||||
*/
|
||||
export function ensureOutputFolders(wordlists: Wordlist[]): void {
|
||||
for (const wordlist of wordlists) {
|
||||
if (!fs.existsSync(wordlist.outputDir)) {
|
||||
fs.mkdirSync(wordlist.outputDir, { recursive: true });
|
||||
console.log(
|
||||
`📁 Created target folder: worddata/${wordlist.language}/${wordlist.pos}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(
|
||||
"✅ All required output directories have been verified and created successfully.",
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue