Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New: Add script to upgrade box-annotations version in Preview #468

Merged
merged 1 commit into from
Nov 6, 2017

Conversation

pramodsum
Copy link
Contributor

No description provided.

}

get_changelog() {
CHANGELOG="$(curl https://raw.githubusercontent.com/box/box-annotations/master/CHANGELOG.md | awk '/\#/{f=1} f{print; if (/\<a/) exit}' | grep . | sed 's/\<a.*//')";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regex breakdown

# Get raw changelog from github
curl https://raw.githubusercontent.com/box/box-annotations/master/CHANGELOG.md 

# Get latest commit by parsing raw changelog for first instance of # until the next instance of <a> tag 
awk '/\#/{f=1} f{print; if (/\<a/) exit}' 

# Remove extra new lines
grep . 

# Removes ending <a> tag from string
sed 's/\<a.*//'

export NODE_PATH=$NODE_PATH:./node_modules

update_version() {
CURRENT_VERSION="$(cat package.json | grep box-annotations | sed 's/.*\^\(.*\)\".*/\1/')";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# Gets string between ^ and " characters from line containing box-annotations in package.json 
# i.e. "box-annotations": "^0.1.0",
sed 's/.*\^\(.*\)\".*/\1/'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the 1 at the end mean?

export NODE_PATH=$NODE_PATH:./node_modules

update_version() {
CURRENT_VERSION="$(cat package.json | grep box-annotations | sed 's/.*\^\(.*\)\".*/\1/')";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does the 1 at the end mean?


push_to_github() {
# Add new files
git add . && git commit -m "Update: box-annotations to v$UPDATED_VERSION" -m "https://github.com/box/box-annotations/releases" -m "$CHANGELOG"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@pramodsum pramodsum merged commit 7de9e4a into box:master Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants