feature(update) add git check

Add check of `.git` directory before running `git pull`.
This commit is contained in:
tarzak 2014-06-25 16:42:48 +03:00
parent a601d09d4f
commit 424c0413fb

View file

@ -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);
});
};
/**