Files
road-compiler/bin/road-workbench.js

15 lines
588 B
JavaScript
Executable File

#!/usr/bin/env node
"use strict";
const path = require("path");
const { startWorkbench } = require("../workbench/server");
const fs = require("fs");
const args = process.argv.slice(2);
const index = args.indexOf("--input");
const inputFile = index >= 0 && args[index + 1] ? path.resolve(args[index + 1]) : null;
const input = inputFile ? JSON.parse(fs.readFileSync(inputFile, "utf8")) : null;
const portIndex = args.indexOf("--port");
const port = portIndex >= 0 ? Number(args[portIndex + 1]) : 8787;
startWorkbench({ input, inputFile, repoRoot: path.resolve(__dirname, ".."), port });