import path from "path";
import fs from "fs";

function getContentDirectory(name) {
  return path.join(process.cwd(), "public", name)
}

function getAllPictures() {
  const contentDirectory = getContentDirectory("img");
  const fileNames = fs.readdirSync(contentDirectory);
  console.log(`gACD: total pictures: ${fileNames.length}`);

  return fileNames.map(f => "/img/" + f);
}

export {
  getAllPictures
};
