-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
ping.js
31 lines (25 loc) · 885 Bytes
/
ping.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env node
var fs = require('fs');
var stdin = process.openStdin();
try {
var uid = fs.readFileSync('./.projects_config', 'utf8');
} catch(e) {
console.log("\n======\nMake sure to download the '.projects_config' file from the project page on Pluralsight and add it to the root directory of this project then re-run this command.\n======\n\n");
process.exit(1);
}
stdin.resume();
stdin.setEncoding('utf8');
// This should be called with a "report" that represents the tests that were run.
stdin.on('data', function(report) {
try {
var parsedData = JSON.parse(report);
// Send the data over to the Projects application
console.log("Todo: Send report to Pluralsight:", uid)
} catch(e) {
// Skip doing anything with this result
}
});
// When running without watch argument, exit after running
stdin.on('end', function () {
process.exit(0);
});