Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 51d022d

Browse files
committed
Update release script
1 parent 9c0dc15 commit 51d022d

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

release.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,9 @@ if ! [[ "$VERSION" =~ ^([0-9]\.[0-9]\.[0-9]) ]]; then
6464
fi
6565

6666

67-
# make sure tests pass
68-
if ! npm test; then
69-
echo 'Tests failed... cannot create release'
70-
exit
71-
fi
72-
7367
# update package.json and package-lock.json
74-
if ! sed -i 's/"version": "[^"]*"/"version": "'$VERSION'"/' package.json; then
75-
echo 'version not replaced in package-lock.json'
68+
if ! npm version --git-tag-version=false $VERSION; then
69+
echo 'Version not updated'
7670
exit
7771
fi
7872

@@ -83,16 +77,16 @@ if ! npm run build; then
8377
fi
8478

8579

86-
# make sure types are up-to-date
87-
if ! npm run build:types; then
88-
echo 'types not generated'
80+
# make sure tests pass
81+
if ! npm test; then
82+
echo 'Tests failed... cannot create release'
8983
exit
9084
fi
9185

9286

9387
# prompt before finalizing
9488
if ! ask "Version $VERSION is ready for release. Are you sure?"; then
95-
echo 'release aborted'
89+
echo 'Release aborted'
9690
exit
9791
fi
9892

0 commit comments

Comments
 (0)