Skip to content

Commit d0c2f73

Browse files
committed
fix: do git commir only if it is in dirty state
1 parent 96b820d commit d0c2f73

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

bin/updep.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,17 @@ for svc in "${services[@]}"; do
108108
fi
109109

110110
if [[ do_commit -eq 1 ]]; then
111-
git commit -am "chore: dependencies update"
111+
if [[ $(git diff --stat) != '' ]]; then
112+
git commit -am "chore: dependencies update"
112113

113-
case "${v_type}" in
114-
minor|major|patch|prerelease) ;;
115-
*) v_type="prerelease"
116-
esac
114+
case "${v_type}" in
115+
minor|major|patch|prerelease) ;;
116+
*) v_type="prerelease"
117+
esac
117118

118-
npm version "$v_type"
119-
git push --follow-tags
119+
npm version "$v_type"
120+
git push --follow-tags
121+
fi
120122
fi
121123

122124
cd ${cwd}

0 commit comments

Comments
 (0)