fix: assert node version (#229)

* assert node version

* chore: moved assert node fuction to separate file
This commit is contained in:
Andriy Leliv
2020-11-27 17:00:23 +02:00
committed by GitHub
parent 258820349b
commit be0a7e5e40
5 changed files with 66 additions and 23 deletions

View File

@@ -1,7 +1,6 @@
import { basename, dirname, extname, join, resolve } from 'path';
import { blue, gray, green, red, yellow } from 'colorette';
import { performance } from "perf_hooks";
import * as colors from 'colorette';
import * as glob from 'glob-promise';
import * as yaml from 'js-yaml';
import * as fs from 'fs';
@@ -79,7 +78,7 @@ export function getExecutionTime(startedAt: number) {
export function printExecutionTime(commandName: string, startedAt: number, entrypoint: string) {
const elapsed = getExecutionTime(startedAt);
process.stderr.write(colors.gray(`\n${entrypoint}: ${commandName} processed in ${elapsed}\n\n`));
process.stderr.write(gray(`\n${entrypoint}: ${commandName} processed in ${elapsed}\n\n`));
}
export function pathToFilename(path: string) {
@@ -279,6 +278,6 @@ export function printUnusedWarnings(config: LintConfig) {
}
export function exitWithError(message: string) {
process.stderr.write(red(message));
process.stderr.write(red(message)+ '\n\n');
process.exit(1);
}