Skip to content

Commit

Permalink
fix CLI output issues, v2.0.0-beta.4
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Oct 6, 2023
1 parent 0f04671 commit 2491e0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
| --------------------------- | ----------------------- |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
10 changes: 5 additions & 5 deletions src/nodeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 2491e0d

Please sign in to comment.