diff --git a/lib/src/commiter.dart b/lib/src/commiter.dart index d469c38..204d9fc 100644 --- a/lib/src/commiter.dart +++ b/lib/src/commiter.dart @@ -110,6 +110,12 @@ class PkgCommiter { void push() { injectGh(); + var res = execCmdResultSync('git pull'); + if (res.exitCode != 0) { + error(res.stderr); + setFailed('git pull failed'); + } + final result = execCmdResultSync('git push origin main'); if (result.exitCode != 0) { error(result.stderr); diff --git a/lib/src/pub.dart b/lib/src/pub.dart index e11e3d1..a396a6b 100644 --- a/lib/src/pub.dart +++ b/lib/src/pub.dart @@ -38,5 +38,11 @@ Future publishPkg( } info(result.stdout.toString()); + + if (dryRun) { + info('Dry run publish ${pkg.name} success.'); + return; + } + info('Publish ${pkg.name} ${pkg.version} success.'); }