Authored by xuqi

update code

@@ -106,7 +106,7 @@ class Build { @@ -106,7 +106,7 @@ class Build {
106 106
107 if(sh.ls(config.codeDir).indexOf(this.project.name) > -1) { 107 if(sh.ls(config.codeDir).indexOf(this.project.name) > -1) {
108 update = true; 108 update = true;
109 - syncCodeScript = 'git submodule update'; 109 + syncCodeScript = `git pull origin ${self.branch}`;
110 } else { 110 } else {
111 syncCodeScript = `git submodule add -f ${this.project.gitlab}`; 111 syncCodeScript = `git submodule add -f ${this.project.gitlab}`;
112 } 112 }
@@ -118,17 +118,11 @@ class Build { @@ -118,17 +118,11 @@ class Build {
118 118
119 if (update) { 119 if (update) {
120 sh.cd(self.codePath); 120 sh.cd(self.codePath);
121 - var pullChild = sh.exec(`git pull origin ${self.branch}`, {  
122 - silent: true  
123 - });  
124 -  
125 - if (pullChild.code !== 0) {  
126 - reject(new Error(`pull code fail`));  
127 - } 121 + } else {
  122 + sh.cd(config.codeDir);
128 } 123 }
129 124
130 // 回到上级目录更新 125 // 回到上级目录更新
131 - sh.cd(config.codeDir);  
132 126
133 let child = sh.exec(syncCodeScript, { 127 let child = sh.exec(syncCodeScript, {
134 silent: self.silent, 128 silent: self.silent,