2022-08-27 22:57:51 +00:00
|
|
|
import { Cli } from './cli.ts';
|
2022-08-07 23:51:36 +00:00
|
|
|
|
2022-08-27 22:57:51 +00:00
|
|
|
class GameCI {
|
|
|
|
|
public static async run() {
|
2022-08-07 23:51:36 +00:00
|
|
|
try {
|
2022-08-27 22:57:51 +00:00
|
|
|
const { command, options } = await new Cli().validateAndParseArguments();
|
2022-08-21 17:21:15 +00:00
|
|
|
|
2022-08-27 22:57:51 +00:00
|
|
|
const success = await command.execute(options);
|
2022-08-07 23:51:36 +00:00
|
|
|
|
2022-08-27 22:57:51 +00:00
|
|
|
if (!success) throw new Error(`${command.name} failed.`);
|
2022-08-07 23:51:36 +00:00
|
|
|
} catch (error) {
|
2022-08-29 00:02:59 +00:00
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
console.error(error);
|
2022-08-07 23:51:36 +00:00
|
|
|
Deno.exit(1);
|
|
|
|
|
}
|
2021-03-13 23:44:01 +00:00
|
|
|
}
|
|
|
|
|
}
|
2022-06-07 21:59:34 +00:00
|
|
|
|
2022-08-27 22:57:51 +00:00
|
|
|
await GameCI.run();
|