From 2491e0d9e419c51ad65eb7d6315448640d5b9e23 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Fri, 6 Oct 2023 17:27:21 +0200 Subject: [PATCH] fix CLI output issues, v2.0.0-beta.4 --- README.md | 2 +- package.json | 2 +- src/cli.js | 2 +- src/nodeUtils.js | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c2c9d92..33faee1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ See the [STAC Validator Comparison](COMPARISON.md) for the features supported by ## Versions -**Current version: 2.0.0-beta.3** +**Current version: 2.0.0-beta.4** | STAC Node Validator Version | Supported STAC Versions | | --------------------------- | ----------------------- | diff --git a/package.json b/package.json index da42f89..7e63bf9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stac-node-validator", - "version": "2.0.0-beta.3", + "version": "2.0.0-beta.4", "description": "STAC Validator for NodeJS", "author": "Matthias Mohr", "license": "Apache-2.0", diff --git a/src/cli.js b/src/cli.js index 196d44c..3ff973a 100644 --- a/src/cli.js +++ b/src/cli.js @@ -81,7 +81,7 @@ async function run() { // Finally run validation const result = await validate(data, config); - // Print not supported error once for API lists + // Print not a "supported error" once for API lists if (result.apiList) { printLint(null, config); } diff --git a/src/nodeUtils.js b/src/nodeUtils.js index dc866cf..fbc6ad9 100644 --- a/src/nodeUtils.js +++ b/src/nodeUtils.js @@ -53,11 +53,11 @@ function printLint(lint, config) { console.info('File was malformed -> fixed the issue'); } else { - console.error('File is malformed -> use `--format` to fix the issue'); + console.warn('File is malformed -> use `--format` to fix the issue'); } } if (lint.error) { - console.error(lint.error); + console.warn(lint.error); } if (lint.diff) { console.groupCollapsed("File Diff"); @@ -68,9 +68,9 @@ function printLint(lint, config) { } else if (!lint.valid && !lint.fixed) { console.group(title); - console.error('File is malformed -> use `--format` to fix the issue'); + console.warn('File is malformed -> use `--format` to fix the issue'); if (lint.error) { - console.error(lint.error); + console.warn(lint.error); } console.groupEnd(); } @@ -160,7 +160,7 @@ function printAjvValidationResult(result, category, reportValid, config) { }) .map(error => makeAjvErrorMessage(error)) // Convert to string .filter((value, i, array) => array.indexOf(value) === i) // Remove duplicates - .forEach((msg, i) => console.error(`${i+1}. ${msg}`)); // Print it as list + .forEach((msg, i) => console.warn(`${i+1}. ${msg}`)); // Print it as list } console.groupEnd(); }