Skip to content

Commit 9f672f9

Browse files
Merge pull request #19 from yunusga/upgrade
Closes #18, Add notice to console about possible not installed Java and update vnu-jar from 20.6.30 to 21.10.12
2 parents f9c3ff1 + bf77cad commit 9f672f9

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

lib/validator.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,18 @@ function nodeW3CValidator (validationPath, userOptions, done) {
218218
}
219219
}
220220

221+
// Test for Java Installed
222+
try {
223+
JSON.parse(stderr); // JSON string with empty "messages"
224+
} catch (e) {
225+
console.log('\n');
226+
console.log(chalk.red('ERROR:'), 'An unexpected error has occurred');
227+
console.log('It looks like you haven\'t installed Java');
228+
console.log('- https://github.com/dutchenkoOleg/node-w3c-validator#attention');
229+
console.log('- https://java.com');
230+
process.exit(1);
231+
}
232+
221233
if (err === null) {
222234
output = stdout;
223235
spinner.succeed(`${pkg.name} - no errors`);

package-lock.json

Lines changed: 8 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"lodash": ">=4.17.20",
5252
"mkdirp": "^1.0.4",
5353
"ora": "^5.1.0",
54-
"vnu-jar": "^20.6.30"
54+
"vnu-jar": "^21.10.12"
5555
},
5656
"devDependencies": {
5757
"eslint": ">=7.14.0",

0 commit comments

Comments
 (0)