import fs from 'fs';

/* eslint-disable import/prefer-default-export */

export const createCacheDirectories = async (targetDir) => {
  if (!fs.existsSync(targetDir)) {
    console.log(`Directory ${targetDir} does not exist. Creating it.`);
    fs.mkdirSync(targetDir, {
      recursive: true,
    });
  } else {
    console.log(`Directory ${targetDir} already exists.`);
  }
  return true;
};
