Skip to content

Commit

Permalink
fix changelog diffing, add -n flag to disable tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Jan 10, 2014
1 parent 7bf7706 commit eccbf05
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions bin/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,26 @@ VERSION=
# Don't make builds automatically, override with -b flag
BUILD=false

# Make new tags, override with -n
TAG=true

# directory for tools/bin scripts
PA_PREFIX="$PWD/${0%[/\\]*}"

# node script for mucking with package json
VERSIONSCRIPT="$PA_PREFIX/set-version.js"

while getopts ":bfptv:" opt; do
while getopts ":bfnptv:" opt; do
case $opt in
b)
BUILD=true
;;
f)
TEST=false
;;
n)
TAG=false
;;
p)
PULL=true
;;
Expand Down Expand Up @@ -147,14 +153,17 @@ gen_changelog() {
for REPO in ${REPOLIST[@]}; do
pushd $REPO >/dev/null

# strip off the leading folders
RNAME=${REPO##*[/\\]}

# Changelog format: - commit message ([commit](commit url on github))
PRETTY="- %s ([commit](https://github.com/Polymer/$REPO/commit/%h))"
PRETTY="- %s ([commit](https://github.com/Polymer/${RNAME}/commit/%h))"
log "GEN CHANGELOG" "$REPO"

# find slightly older tag, sorted alphabetically
OLD_VERSION="`git tag -l | tail -n 2 | head -n 1`"
OLD_VERSION="`git tag -l | sort -n | tail -n 2 | head -n 1`"
if [[ -n $OLD_VERSION ]]; then
echo "#### ${REPO##*[/\\]}" >> "../../changelog.md"
echo "#### ${RNAME}" >> "../../changelog.md"
git log $OLD_VERSION..$VERSION --pretty="$PRETTY" >> "../../changelog.md"
echo "" >> "../../changelog.md"
fi
Expand Down Expand Up @@ -214,7 +223,9 @@ release() {
if $BUILD; then
build
fi
tag_repos
if $TAG; then
tag_repos
fi
gen_changelog
fi
popd >/dev/null
Expand Down

0 comments on commit eccbf05

Please sign in to comment.