const { cp } = require("fs/promises");

async function main() {  
  console.log("Copying template files...");
  await cp("src/templates", "dist/templates", { recursive: true });
  console.log("Template files copied successfully");

  console.log("Copying README.md into dist/templates/ioconnect-desktop...");
  await cp("README.md", "dist/templates/ioconnect-desktop/README.md");
  console.log("README.md copied successfully");
  
  console.log("Copying tools files...");
  await cp("tools", "dist/tools", { recursive: true });
  console.log("Tools copied successfully");

  console.log("Copying assets files...");
  await cp("assets", "dist/assets", { recursive: true });
  console.log("Assets copied successfully");
}

main().catch(err => {
  console.error(err);
  process.exit(1);
});