-
Notifications
You must be signed in to change notification settings - Fork 116
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
Conversation
} | ||
|
||
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.*//')"; |
There was a problem hiding this comment.
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/')"; |
There was a problem hiding this comment.
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/'
There was a problem hiding this comment.
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/')"; |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
No description provided.