mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 00:13:53 +00:00
45fe669f0a
* refactor: simplify excel import * chore: add external deepmerge utility * chore: create import map utilities * chore: increase size limits on uploads * style: small presentation tweaks * feat: resolve times on excel import, refs #508
16 lines
416 B
TypeScript
16 lines
416 B
TypeScript
import { existsSync, mkdirSync } from 'fs';
|
|
|
|
/**
|
|
* @description Creates a directory if it doesn't exist
|
|
* @param {string} directory - directory that should exist or will be created
|
|
*/
|
|
export function ensureDirectory(directory) {
|
|
if (!existsSync(directory)) {
|
|
try {
|
|
mkdirSync(directory, { recursive: true });
|
|
} catch (err) {
|
|
throw new Error(`Could not create directory: ${err}`);
|
|
}
|
|
}
|
|
}
|