...
|
...
|
@@ -106,7 +106,7 @@ class Build { |
|
|
|
|
|
if(sh.ls(config.codeDir).indexOf(this.project.name) > -1) {
|
|
|
update = true;
|
|
|
syncCodeScript = 'git submodule update';
|
|
|
syncCodeScript = `git pull origin ${self.branch}`;
|
|
|
} else {
|
|
|
syncCodeScript = `git submodule add -f ${this.project.gitlab}`;
|
|
|
}
|
...
|
...
|
@@ -118,17 +118,11 @@ class Build { |
|
|
|
|
|
if (update) {
|
|
|
sh.cd(self.codePath);
|
|
|
var pullChild = sh.exec(`git pull origin ${self.branch}`, {
|
|
|
silent: true
|
|
|
});
|
|
|
|
|
|
if (pullChild.code !== 0) {
|
|
|
reject(new Error(`pull code fail`));
|
|
|
}
|
|
|
} else {
|
|
|
sh.cd(config.codeDir);
|
|
|
}
|
|
|
|
|
|
// 回到上级目录更新
|
|
|
sh.cd(config.codeDir);
|
|
|
|
|
|
let child = sh.exec(syncCodeScript, {
|
|
|
silent: self.silent,
|
...
|
...
|
|