diff --git a/lib/server/update.js b/lib/server/update.js index 74c4e8ef..c65456bf 100644 --- a/lib/server/update.js +++ b/lib/server/update.js @@ -18,8 +18,13 @@ Util = main.util, DIR = main.DIR; - exports.get = function(){ - exec('git pull --rebase', {cwd : DIR}, pull); + exports.get = function() { + fs.readdir(DIR, function(err, list) { + var isGit = list.indexOf('.git') >= 0; + + if (!err && isGit) + exec('git pull --rebase', {cwd : DIR}, pull); + }); }; /**