mirror of
https://github.com/kemko/resume.git
synced 2026-01-01 15:55:47 +03:00
19 lines
459 B
TypeScript
19 lines
459 B
TypeScript
import fs from 'node:fs';
|
|
|
|
export const checkFileExists = (filePath: string) => {
|
|
if (!fs.existsSync(filePath)) {
|
|
console.error(`File ${filePath} does not exist.`);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
export const checkFolderExists = (folderPath: string) => {
|
|
const folder = folderPath.split('/').slice(0, -1).join('/');
|
|
if (!fs.existsSync(folder)) {
|
|
console.error(`Folder ${folder} does not exist.`);
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|