const { removeDir, copyDir, fix2 } = require('./utils');
const compressing = require('compressing');

async function main() {
  await removeDir('./publish/play');
  await removeDir('./publish/form');

  await copyDir('../play/build/web-desktop', './publish/play');
  compressing.zip.uncompress('../form/publish/form.zip', './publish/form');

  const data = await fs.readFileSync('./index.html');
  await fs.writeFileSync('./publish/play/index.html', data);

  await removeDir('../play/build/web-desktop');
}

main();