UNPKG

statigen

Version:

A static site generator that supports html, ejs, and markdown source files

46 lines 1.67 kB
#!/usr/bin/env node "use strict"; /* eslint-disable @typescript-eslint/no-unused-expressions */ Object.defineProperty(exports, "__esModule", { value: true }); const yargs = require("yargs"); const InitCommand_1 = require("./InitCommand"); const StaticSiteGenerator_1 = require("./StaticSiteGenerator"); yargs .usage('$0', 'A simple convention-based static site generator for markdown files') .help('help', 'View help information about this tool.') .command('$0 [files..]', '', (yargs) => { return yargs .option('sourceDir', { description: `Path to the directory containing your source files`, alias: 's', type: 'string', default: 'src' }) .option('outDir', { description: `Path to the directory where the output file should be written.`, alias: 'o', type: 'string', default: 'dist' }) .option('cwd', { description: `Path to the current working directory where the tool should run.`, type: 'string' }) .option('watch', { description: `If true, the program will run in watch mode and rebuild on every source file change. This also starts a web server to host the generated site.`, type: 'boolean', default: false }); }, (argv) => { const generator = new StaticSiteGenerator_1.StaticSiteGenerator(); generator.run(argv).catch((e) => { console.error(e); process.exit(1); }); }) .command('init [path]', '', () => { }, (argv) => { const initCommand = new InitCommand_1.InitCommand(); initCommand.run({ path: argv.path }); }) .argv; //# sourceMappingURL=cli.js.map