Browse files

change all path.exists* -> fs.exists*

  • Loading branch information...
1 parent 5bd0eb3 commit f29f0c73d63f10f1399d89f238d41a49f9b00499 @dominictarr committed Jul 5, 2012
Showing with 5 additions and 7 deletions.
  1. +2 −4 bin/cmd.js
  2. +1 −1 lib/config.js
  3. +2 −2 lib/git_dir.js
View
6 bin/cmd.js
@@ -3,8 +3,6 @@ var path = require('path');
var fs = require('fs');
var exec = require('child_process').exec;
-var existsSync = fs.exists || path.existsSync
-
var request = require('request');
var semver = require('semver');
@@ -39,8 +37,8 @@ withConfig(function (config) {
}
else {
var dir = gitDir(process.cwd());
- if (!existsSync(dir + '/.travis.yml')
- && existsSync(dir + '/package.json')) {
+ if (!fs.existsSync(dir + '/.travis.yml')
+ && fs.existsSync(dir + '/package.json')) {
var pkg = JSON.parse(fs.readFileSync(dir + '/package.json'));
var sv = (pkg.engines || {}).node || '>=0.4';
View
2 lib/config.js
@@ -20,7 +20,7 @@ module.exports = function (cb) {
})
}
- path.exists(file, function (ex) {
+ fs.exists(file, function (ex) {
if (!ex) prompt(function (vars) {
fs.writeFile(file, JSON.stringify(vars), function (err) {
if (err) console.error(err)
View
4 lib/git_dir.js
@@ -1,9 +1,9 @@
-var path = require('path');
+var fs = require('fs');
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 (fs.existsSync(p + '/.git')) return p;
}
};

0 comments on commit f29f0c7

Please sign in to comment.