Permalink
Browse files

existsSync bleh

  • Loading branch information...
1 parent 94f98aa commit 414909ebdddfd212332a612dd7fbe4ab86761158 @substack committed Jul 18, 2012
Showing with 10 additions and 5 deletions.
  1. +3 −2 bin/cmd.js
  2. +2 −1 lib/config.js
  3. +4 −1 lib/git_dir.js
  4. +1 −1 package.json
View
@@ -2,6 +2,7 @@
var path = require('path');
var fs = require('fs');
var exec = require('child_process').exec;
+var existsSync = fs.existsSync || path.existsSync;
var request = require('request');
var semver = require('semver');
@@ -37,8 +38,8 @@ withConfig(function (config) {
}
else {
var dir = gitDir(process.cwd());
- if (!path.existsSync(dir + '/.travis.yml')
- && path.existsSync(dir + '/package.json')) {
+ if (!existsSync(dir + '/.travis.yml')
+ && existsSync(dir + '/package.json')) {
var pkg = JSON.parse(fs.readFileSync(dir + '/package.json'));
var sv = (pkg.engines || {}).node || '>=0.4';
View
@@ -1,5 +1,6 @@
var fs = require('fs');
var path = require('path');
+var exists = fs.exists || path.exists;
var mkdirp = require('mkdirp');
var tty = require('tty');
@@ -20,7 +21,7 @@ module.exports = function (cb) {
})
}
- path.exists(file, function (ex) {
+ exists(file, function (ex) {
if (!ex) prompt(function (vars) {
fs.writeFile(file, JSON.stringify(vars), function (err) {
if (err) console.error(err)
View
@@ -1,9 +1,12 @@
var path = require('path');
+var fs = require('fs');
+var path = require('path');
+var existsSync = fs.existsSync || path.existsSync;
module.exports = function (dir) {
var ps = dir.split('/');
for (var i = ps.length; i > 0; i--) {
var p = ps.slice(0, i).join('/');
- if (path.existsSync(p + '/.git')) return p;
+ if (existsSync(p + '/.git')) return p;
}
};
View
@@ -1,7 +1,7 @@
{
"name" : "travisify",
"description" : "add travis-ci hooks to github",
- "version" : "0.1.7",
+ "version" : "0.1.8",
"repository" : {
"type" : "git",
"url" : "git://github.com/substack/travisify.git"

0 comments on commit 414909e

Please sign in to comment.