File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 5656 working-directory : packages/msw-dev-tool
5757 run : |
5858 CURRENT_VERSION=$(cat package.json | jq -r '.version')
59- if [ "$CURRENT_VERSION" != "${{ env.npm_version }}" ]; then
60- npm version ${{ env.npm_version }} --no-git-tag-version
59+ REGISTRY_VERSION=${{ env.npm_version }}
60+
61+ # Compare version
62+ function version_gt() {
63+ test "$(printf '%s\n' "$1" "$2" | sort -V | head -n 1)" != "$1"
64+ }
65+
66+ if version_gt "$CURRENT_VERSION" "$NPM_VERSION"; then
67+ echo "Local version: ($CURRENT_VERSION) is higher then registry version: ($NPM_VERSION). Maintain local version."
68+ elif [ "$CURRENT_VERSION" != "$NPM_VERSION" ]; then
69+ echo "Registry version: ($NPM_VERSION) is higher then ($CURRENT_VERSION). Update local version."
70+ npm version $NPM_VERSION --no-git-tag-version
6171 else
6272 echo "Versions are the same, no need to update."
6373 fi
You can’t perform that action at this time.
0 commit comments