diff --git a/lib/gitsync.js b/lib/gitsync.js index 25288d3..64edc1f 100755 --- a/lib/gitsync.js +++ b/lib/gitsync.js @@ -40,7 +40,7 @@ GitSync.prototype.align = function(repoDir, branch, callback) { // Remove git lock file to recover if git operation was aborted during previous run. function(cb) { var lockFile = path.join(repoDir, '.git', 'index.lock'); - path.exists(lockFile, function(exists) { + fs.exists(lockFile, function(exists) { if (exists) { fs.unlink(lockFile, function(err) { if (err) { @@ -63,7 +63,7 @@ GitSync.prototype.align = function(repoDir, branch, callback) { if (err) { log.warn('git status failed on ' + repoDir + ":", err.msg); var indexFile = path.join(repoDir, '.git', 'index'); - path.exists(indexFile, function(exists) { + fs.exists(indexFile, function(exists) { if (exists) { fs.unlink(indexFile, function(err) { if (err) { @@ -181,7 +181,7 @@ GitSync.prototype.sync = function(url, branch, dir, callback) { // check if we already have a directory by that name // if we do, assume it is already cloned and just pull. - path.exists(dir, function(exists) { + fs.exists(dir, function(exists) { if (exists) { @@ -221,14 +221,14 @@ GitSync.prototype.clonebranch = function(url, branch, dir, callback) { var self = this; // make sure root directory exists var root = path.dirname(dir); - path.exists(root, function(exists) { + fs.exists(root, function(exists) { if (!exists) { log.error('root directory ' + root + ' does not exist'); callback("parent of dir must exists (" + root + ")"); return; } - path.exists(dir, function(exists) { + fs.exists(dir, function(exists) { // If directory for branch already exists, need to remove it if (exists) { rimraf(dir, function(err) { @@ -601,7 +601,7 @@ function _defaultCallback(err) { function _ensureExists(dir, callback) { dir = path.resolve(dir); // make full path - path.exists(dir, function(exists) { + fs.exists(dir, function(exists) { if (!exists) { // ensure that the parent dir exists _ensureExists(path.dirname(dir), function(err) {