Skip to content

Commit 8c00921

Browse files
committed
Handle publish fails due to same version
1 parent 51a0fbd commit 8c00921

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

build/bumpAndPublish.sh

+13-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@ npm run bump-version
33
result=$?
44

55
if [ $result -eq 0 ]; then
6-
npx vsce publish $f --pat $1 --noVerify
7-
exit
6+
output="$(npx vsce publish $f --pat $1 --noVerify 2>&1)"
7+
publishResult=$?
8+
echo $output
9+
if [ $publishResult -eq 0 ]; then
10+
exit
11+
elif [[ $output =~ "already exists" ]]; then
12+
echo "Publish failed but expected. Skipping publishing same version."
13+
exit
14+
else
15+
echo "Error publishing"
16+
exit 1
17+
fi;
818
elif [ $result -eq 1 ]; then
9-
echo "Skipping publishing new version"
19+
echo "Skipping publishing same version"
1020
exit
1121
else
1222
echo "Error. Exited with $result"

0 commit comments

Comments
 (0)