Skip to content

Commit

Permalink
Moved git pull up to avoid potential merge conflicts, deleted line …
Browse files Browse the repository at this point in the history
…breaks for compactness
  • Loading branch information
adamlui committed Dec 23, 2024
1 parent 3535bfb commit 8c82c65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions utils/bump.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ if [[ ! "${ver_types[@]}" =~ "$1" ]] ; then
echo "${BR}Invalid version argument. Please specify 'major', 'minor', or 'patch'.${NC}"
exit 1 ; fi

# PULL latest changes
echo -e "${BY}Pulling latest changes from remote to sync local repository...${NC}\n"
git pull || (echo -e "${BR}Merge failed, please resolve conflicts!${NC}" && exit 1)
echo ''

# Determine new version to bump to
old_ver=$(node -pe "require('./package.json').version")
IFS='.' read -ra subvers <<< "$old_ver" # split old_ver into subvers array
Expand Down Expand Up @@ -91,12 +96,11 @@ git commit -n -m "Built chatgpt.js $NEW_VER"

# Push to GiHub
echo -e "${BY}\nPushing to GitHub...\n${NC}"
git pull && git push
git git push

# Publish to NPM
if [[ "$*" == *"--publish"* ]] ; then
echo -e "${BY}\nPublishing to npm...\n${NC}"
npm publish ; fi
echo -e "${BY}\nPublishing to npm...\n${NC}" ; npm publish ; fi

# Print final summary
echo -e "\n${BG}Successfully bumped to v$NEW_VER$(
Expand Down

0 comments on commit 8c82c65

Please sign in to comment.