Skip to content

Commit b1df716

Browse files
author
Miel Vander Sande
committed
Added different statuscodes & dev server
1 parent 03ccb2f commit b1df716

File tree

5 files changed

+5559
-1591
lines changed

5 files changed

+5559
-1591
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,17 @@ Examples:
1818
## Or install the browser client
1919

2020
```bash
21+
# Equivalent to: npm build
2122
npm install
2223
browserify lib/validator.js -o public/js/ttl.js
2324
```
2425

2526
Then use it in your browser using the index.html in the public folder.
27+
You can run this locally as follows.
28+
29+
```bash
30+
# Equivalent to: npm start
31+
npm install
32+
browserify lib/validator.js -o public/js/ttl.js
33+
ws
34+
```

TurtleValidator.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ function validateArgument(arg) {
4545
validate(res, showValidation);
4646
}).on('error', function (e) {
4747
console.log("Got error: " + e.message);
48+
process.exit(1);
4849
});
4950
break;
5051
case null:
5152
validate(fs.createReadStream(parsedUrl.href), showValidation);
5253
break;
5354
default:
5455
console.log('Cannot access %s: "%s" not supported', parsedUrl.href, parsedUrl.protocol)
56+
process.exit(1);
5557
}
5658
}
5759

@@ -64,4 +66,5 @@ function showValidation(feedback) {
6466
console.log('WARNING: ' + warning);
6567
});
6668
console.log("Validator finished with " + feedback.warnings.length + " warnings and " + feedback.errors.length + " errors.");
69+
process.exit(feedback.errors.length > 0 ? 2 : 0);
6770
}

0 commit comments

Comments
 (0)