UNPKG

651 BJavaScriptView Raw
1#!/usr/bin/env node
2
3var program = require('commander');
4var meta = require('../package.json');
5var spawn = require('child_process').spawn;
6
7program
8 .version(meta.version)
9 .command('build [path]', 'build document from the directory')
10 .command('install [path]', 'install theme or plugin')
11 .command('preview [path]', 'build and preview the document from directory')
12 .parse(process.argv);
13
14if (!/(build|install|preview|help)/.test(process.argv[2])) {
15 spawn(
16 process.argv[1], // firedoc
17 ['build'].concat(process.argv.slice(2)), // arguments
18 {
19 'stdio': 'inherit',
20 'env': process.env
21 }
22 );
23}