if [ "$1" ]; then npm --no-git-tag-version version $1 VERSION=$1 else npm --no-git-tag-version version patch VERSION=$(node -p "require('./package.json').version") fi npm run changelog git add . git commit -m "build: build $VERSION" git tag $VERSION echo "\nVersion v$VERSION update succeeded!\n"