mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-19 01:17:18 +00:00
feature(update) add git check
Add check of `.git` directory before running `git pull`.
This commit is contained in:
parent
a601d09d4f
commit
424c0413fb
1 changed files with 7 additions and 2 deletions
|
|
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue