aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorelliottcable <[email protected]>2013-05-24 02:42:15 -0400
committerelliottcable <[email protected]>2013-05-24 02:42:15 -0400
commit92783b483630b516b83cab3b555cce2fb5b79982 (patch)
tree2b7c224fd47b0e778992714c5a0432b3ea16d373 /bin
parented578c2d1944c7122a5b1bbde0622513dcf87cc2 (diff)
downloadnode-coveralls-92783b483630b516b83cab3b555cce2fb5b79982.tar.xz
node-coveralls-92783b483630b516b83cab3b555cce2fb5b79982.zip
Supporting command-line usage outside of Travis-CI
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--]bin/coveralls.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/bin/coveralls.js b/bin/coveralls.js
index 288b451..d3d18e1 100644..100755
--- a/bin/coveralls.js
+++ b/bin/coveralls.js
@@ -1,4 +1,7 @@
#!/usr/bin/env node
+var fs = require('fs');
+var path = require('path');
+var YAML = require('libyaml');
var sendToCoveralls = require('../lib/sendToCoveralls');
var convertLcovToCoveralls = require('../lib/convertLcovToCoveralls');
@@ -8,18 +11,23 @@ process.stdin.setEncoding('utf8');
var input = '';
process.stdin.on('data', function(chunk) {
- input += chunk;
+ input += chunk;
});
process.stdin.on('end', function() {
- inputToCoveralls(input);
+ inputToCoveralls(input);
});
var inputToCoveralls = function(input){
- console.log(input);
- var libDir = process.argv[2] || '';
-
- convertLcovToCoveralls(input, libDir, function(err, postData){
+ console.log(input);
+ var libDir = process.argv[2] || '';
+
+ var yml = path.join(process.cwd(), '.coveralls.yml');
+ if (fs.statSync(yml).isFile()) {
+ repo_token = YAML.readFileSync(yml)[0]['repo_token'];
+ }
+
+ convertLcovToCoveralls(input, libDir, repo_token, function(err, postData){
if (err){
throw err;
}
@@ -36,5 +44,3 @@ var inputToCoveralls = function(input){
});
};
-
-