UNPKG

uascript

Version:
22 lines (21 loc) 683 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const file_manager_1 = require("./file-manager/file-manager"); const runner_1 = require("./interpreter/runner"); async function main() { const args = process.argv.slice(2); if (!args.length || !args[0] || !args[1]) { process.exit(0); } const isFileCompiler = Boolean(args[0]); if (isFileCompiler && args[2]) { const fromPath = args[1]; const outPath = args[2]; await file_manager_1.compileByPath(fromPath, outPath); } else if (!isFileCompiler) { const source = args[1]; await runner_1.compileAndRunSource(source); } } main();