Skip to content

Commit eccbf05

Browse files
committed
fix changelog diffing, add -n flag to disable tagging
1 parent 7bf7706 commit eccbf05

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

bin/make-release.sh

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,26 @@ VERSION=
1919
# Don't make builds automatically, override with -b flag
2020
BUILD=false
2121

22+
# Make new tags, override with -n
23+
TAG=true
24+
2225
# directory for tools/bin scripts
2326
PA_PREFIX="$PWD/${0%[/\\]*}"
2427

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

28-
while getopts ":bfptv:" opt; do
31+
while getopts ":bfnptv:" opt; do
2932
case $opt in
3033
b)
3134
BUILD=true
3235
;;
3336
f)
3437
TEST=false
3538
;;
39+
n)
40+
TAG=false
41+
;;
3642
p)
3743
PULL=true
3844
;;
@@ -147,14 +153,17 @@ gen_changelog() {
147153
for REPO in ${REPOLIST[@]}; do
148154
pushd $REPO >/dev/null
149155

156+
# strip off the leading folders
157+
RNAME=${REPO##*[/\\]}
158+
150159
# Changelog format: - commit message ([commit](commit url on github))
151-
PRETTY="- %s ([commit](https://github.com/Polymer/$REPO/commit/%h))"
160+
PRETTY="- %s ([commit](https://github.com/Polymer/${RNAME}/commit/%h))"
152161
log "GEN CHANGELOG" "$REPO"
153162

154163
# find slightly older tag, sorted alphabetically
155-
OLD_VERSION="`git tag -l | tail -n 2 | head -n 1`"
164+
OLD_VERSION="`git tag -l | sort -n | tail -n 2 | head -n 1`"
156165
if [[ -n $OLD_VERSION ]]; then
157-
echo "#### ${REPO##*[/\\]}" >> "../../changelog.md"
166+
echo "#### ${RNAME}" >> "../../changelog.md"
158167
git log $OLD_VERSION..$VERSION --pretty="$PRETTY" >> "../../changelog.md"
159168
echo "" >> "../../changelog.md"
160169
fi
@@ -214,7 +223,9 @@ release() {
214223
if $BUILD; then
215224
build
216225
fi
217-
tag_repos
226+
if $TAG; then
227+
tag_repos
228+
fi
218229
gen_changelog
219230
fi
220231
popd >/dev/null

0 commit comments

Comments
 (0)