mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-19 11:26:02 +00:00
* fix(cli): an output in a drive root (D:\) no longer fails before it is written on Windows * fix(cli): keep the output folder helper's reason in its test * fix(cli): make the output folder only when nothing is there, as the producer does * fix(cli): keep the output folder's directory check and fix the stat mock that hid isDirectory
8 lines
264 B
TypeScript
8 lines
264 B
TypeScript
import { mkdirSync, statSync } from "node:fs";
|
|
|
|
const isFolder = (dir: string) => statSync(dir, { throwIfNoEntry: false })?.isDirectory() === true;
|
|
|
|
export function makeOutputFolder(dir: string): void {
|
|
if (!isFolder(dir)) mkdirSync(dir, { recursive: true });
|
|
}
|