Skip to content

Commit

Permalink
Allow baseUrl to be overridden via CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Jul 31, 2019
1 parent 3f3da7e commit c0090fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions bin/generate-infobook-html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {HtmlInfoBookSerializer, ISerializeContext} from "../lib/serialize/HtmlIn

// Process CLI args
const args = minimist(process.argv.slice(2));
if (args.help || args._.length !== 2) {
if (args.help || (args._.length !== 2 && args._.length !== 3)) {
process.stdout.write(`generate-cyclops-infobook-html Output Cyclops infobooks as HTML
Usage:
generate-cyclops-infobook-html /path/to/config.json /path/to/output/
generate-cyclops-infobook-html /path/to/config.json /path/to/output/ [baseUrl]
Options:
--help print this help message
`);
Expand All @@ -31,6 +31,11 @@ async function create() {
// Create infobook from config
const config = JSON.parse(fs.readFileSync(args._[0], "utf8"));

// Override baseUrl
if (args._.length === 3) {
config.baseUrl = args._[2];
}

// Check if registries have been generated
if (!fs.existsSync('registries')) {
process.stderr.write(
Expand Down

0 comments on commit c0090fd

Please sign in to comment.