UNPKG

tsc-junit

Version:

JUnit report generator for typescript

33 lines (32 loc) 1.04 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.start = void 0; const yargs_1 = __importDefault(require("yargs")); const helpers_1 = require("yargs/helpers"); const junit_1 = require("./junit"); const utils_1 = require("./utils"); async function start() { const { output } = await (0, yargs_1.default)((0, helpers_1.hideBin)(process.argv)) .locale('en') .option('output', { alias: 'o', type: 'string', description: 'Output file path', default: 'tsc-junit.xml', }) .usage('tsc-junit\nUsage: tsc --noEmit | tsc-junit') .parse(); const stdin = await (0, utils_1.stdinRead)(); if (stdin) { try { await (0, junit_1.createXML)(output, stdin); } catch (e) { console.error(`x [${e.name}]: ${e.message}`); } } } exports.start = start;