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

17 lines
750 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;
// Keep the diagnostic read model enabled by default. Use --no-debug only when
// running a minimal production-like session.
startWorkbench({ input, inputFile, repoRoot: path.resolve(__dirname, '..'), port, debug: !args.includes('--no-debug') });