feat: make road compiler standalone
This commit is contained in:
1 parent
aadd45bcad
commit
8e79790261
8 files changed
+588
-2
No files matched your search
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
|
||||
const path = require("path");
|
||||
const { startWorkbench } = require("../workbench/server");
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
const index = args.indexOf("--input");
|
||||
if (index < 0 || !args[index + 1]) throw new Error("Usage: road-workbench --input <RoadCompilerInput.json> [--port <port>]");
|
||||
const inputFile = path.resolve(args[index + 1]);
|
||||
const input = require(inputFile);
|
||||
const portIndex = args.indexOf("--port");
|
||||
const port = portIndex >= 0 ? Number(args[portIndex + 1]) : 8787;
|
||||
startWorkbench({ input, inputFile, port });
|
||||
Reference in new issue
Block a user