@farris/cli 1.0.24 → 1.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. package/ci/cli.js +17 -10
  2. package/package.json +1 -1
package/ci/cli.js CHANGED
@@ -245,12 +245,13 @@ function updateMonoWorkspaceVersion(monoWorkspace, updateVersionType, commitUrl)
245
245
  childProcess.execSync('git', ['commit', '-m', `Update MonoWorkspace version to v${packageConfig.version}. [skip ci]`]);
246
246
  console.log(`Update MonoWorkspace version to v${packageConfig.version}`);
247
247
  const branch = childProcess.execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
248
- console.log(`executing git push ${branch}`);
249
248
  // 提交变更集
250
249
  if (commitUrl) {
251
- childProcess.execSync("git", ["push", commitUrl]);
250
+ console.log(`executing git push ${branch} to ${commitUrl}`);
251
+ return childProcess.exec("git", ["push", commitUrl]);
252
252
  } else {
253
- childProcess.execSync('git', ['push']);
253
+ console.log(`executing git push ${branch}`);
254
+ return childProcess.exec('git', ['push']);
254
255
  }
255
256
  }
256
257
 
@@ -267,7 +268,7 @@ function builderVersionChangeMessage(prefix, updatedVersions, suffix = '') {
267
268
  }
268
269
 
269
270
  function commitVersionChanges(updatedVersions, commitUrl) {
270
- const commitMessage = builderVersionChangeMessage('Update', updatedVersions, '. [skip ci]');
271
+ const commitMessage = builderVersionChangeMessage('Update', updatedVersions, ' [skip ci]');
271
272
 
272
273
  if (commitMessage) {
273
274
  // 向git缓冲区中添加变更
@@ -278,12 +279,14 @@ function commitVersionChanges(updatedVersions, commitUrl) {
278
279
  console.log(commitMessage);
279
280
 
280
281
  const branch = childProcess.execSync("git", ["rev-parse", "--abbrev-ref", "HEAD"]);
281
- console.log(`executing git push ${branch}`);
282
+
282
283
  // 提交变更集
283
284
  if (commitUrl) {
284
- childProcess.execSync("git", ["push", commitUrl]);
285
+ console.log(`executing git push ${branch} to ${commitUrl}`);
286
+ return childProcess.exec("git", ["push", commitUrl]);
285
287
  } else {
286
- childProcess.execSync('git', ['push']);
288
+ console.log(`executing git push ${branch}`);
289
+ return childProcess.exec('git', ['push']);
287
290
  }
288
291
  }
289
292
  }
@@ -399,9 +402,13 @@ function publish(commitUrl, updateVersionType) {
399
402
  return workspace;
400
403
  }, monoWorkspace);
401
404
  const updatedVersions = monoWorkspace.updateResult;
402
- commitVersionChanges(updatedVersions, commitUrl);
403
- updateMonoWorkspaceVersion(monoWorkspace, updateVersionType, commitUrl);
404
- return Promise.resolve(monoWorkspace);
405
+ return commitVersionChanges(updatedVersions, commitUrl)
406
+ .then((result) => {
407
+ return updateMonoWorkspaceVersion(monoWorkspace, updateVersionType, commitUrl);
408
+ })
409
+ .then((reulst) => {
410
+ return Promise.resolve(monoWorkspace);
411
+ });
405
412
  });
406
413
  });
407
414
  // 5. 编译所有Angular工作区
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farris/cli",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Farris command line interface",
5
5
  "main": "index.js",
6
6
  "scripts": {