compileChanged.ts 612 B

1234567891011121314151617181920212223
  1. import actions from "@actions/core";
  2. import chalk from "chalk";
  3. import PresenceCompiler from "../classes/PresenceCompiler.js";
  4. import { getDiff } from "../util.js";
  5. const compiler = new PresenceCompiler(),
  6. changedFolders = getDiff();
  7. if (!changedFolders.length)
  8. actions.info(chalk.green("No Presences changed, exiting..."));
  9. else {
  10. const errors = await compiler.compilePresence(changedFolders, {
  11. emit: false,
  12. });
  13. for (const error of errors.filter(error => !error.name.includes("TS")))
  14. actions.error(error);
  15. if (errors.length)
  16. actions.setFailed("Some Presences failed to compile, exiting...");
  17. }