18 lines
433 B
TypeScript
18 lines
433 B
TypeScript
// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts
|
|
if (import.meta.main) {
|
|
await main();
|
|
}
|
|
|
|
async function main(): Promise<number> {
|
|
const args = globalThis.Deno.args;
|
|
if (!args || args.length !== 1) {
|
|
return Promise.resolve(-1);
|
|
}
|
|
const day = parseInt(args[0]);
|
|
|
|
const module = await import(`./exercises/day_${day}.ts`);
|
|
await module.default();
|
|
|
|
return Promise.resolve(0);
|
|
}
|