#!/usr/bin/env node

import { join } from "path";

import { Script } from "./script.js";


const argv = process.argv.slice(2);

// No folder specified; use current folder
if (argv.length === 0) { argv.push("."); }

(async function() {
    for (const path of argv) {
        try {
            const script = new Script(join(path, "ducki.js"));
            await script.run();
        } catch (e: any) {
            console.log(`Error: ${ e.message } (${ path })`);
        }
    }
})();
