INNER CODE UNIT · JavaScript

ensureDirectoryExists

o19s/quepid · build_css.js:17

function ensureDirectoryExists(dirPath) {
  if (!fs.existsSync(dirPath)) {
    fs.mkdirSync(dirPath, { recursive: true });
  }
}

function readFileIfExists(filePath) {
  try {
    if (fs.existsSync(filePath)) {
      return fs.readFileSync(filePath, 'utf8');
    }
  } catch (error) {
    console.warn(`Warning: Could not read ${filePath}:`, error.message);
  }
  return '';
}

function copyFileIfExists(src, dest) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…