UNPKG

markuplint

Version:

A Linter for All Markup Languages.

34 lines (33 loc) 1.14 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const cli_bootstrap_1 = require("./cli-bootstrap"); const command_1 = require("./command"); const get_stdin_1 = __importDefault(require("get-stdin")); if (cli_bootstrap_1.cli.flags.v) { cli_bootstrap_1.cli.showVersion(); // And exit successfully. } if (cli_bootstrap_1.cli.flags.h) { cli_bootstrap_1.cli.showHelp(0); // And exit successfully. } if (cli_bootstrap_1.cli.input.length) { command_1.command(Object.assign({ files: cli_bootstrap_1.cli.input }, cli_bootstrap_1.cli.flags)).catch(err => { process.stderr.write(err + '\n'); process.exit(1); }); } else { cli_bootstrap_1.cli.showHelp(1); // And fail. } get_stdin_1.default().then(stdin => { const html = stdin; if (!html) { return; } command_1.command(Object.assign({ codes: html }, cli_bootstrap_1.cli.flags)).catch(err => { process.stderr.write(err + '\n'); process.exit(1); }); });