mirror of
https://github.com/LukeHagar/redocly-cli.git
synced 2025-12-10 12:47:49 +00:00
feat: bundle document before gathering stats (#227)
* feat: bundle document before gathering stats * exitWithError moved to utils
This commit is contained in:
@@ -4,7 +4,7 @@ import * as yaml from 'js-yaml';
|
||||
import * as path from 'path';
|
||||
import { performance } from 'perf_hooks';
|
||||
const isEqual = require('lodash.isequal');
|
||||
import { printExecutionTime, pathToFilename, readYaml, writeYaml } from '../../utils';
|
||||
import { printExecutionTime, pathToFilename, readYaml, writeYaml, exitWithError } from '../../utils';
|
||||
import { isString, isObject, isEmptyObject } from '../../js-utils';
|
||||
import {
|
||||
Definition,
|
||||
@@ -69,11 +69,6 @@ function isNotYaml(filename: string) {
|
||||
return !(filename.endsWith('.yaml') || filename.endsWith('.yml'));
|
||||
}
|
||||
|
||||
function exitWithError(message: string) {
|
||||
process.stderr.write(red(message));
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function loadFile(fileName: string) {
|
||||
try {
|
||||
return yaml.safeLoad(fs.readFileSync(fileName, 'utf8')) as Definition;
|
||||
|
||||
Reference in New Issue
Block a user