Skip to content

Commit 44a0d77

Browse files
committed
upd release script.
now it can handle the first release case. when no previous tags are there
1 parent 9604edd commit 44a0d77

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

Diff for: bin/release

+14-8
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,24 @@ do
3232
git checkout $CURRENT_BRANCH;
3333
# gsort comes with coreutils packages. brew install coreutils
3434
LAST_RELEASE=$(git tag -l [0-9].* | gsort -V | tail -n1 )
35-
36-
echo "Last release $LAST_RELEASE";
37-
38-
CHANGES_SINCE_LAST_RELEASE=$(git log "$LAST_RELEASE"...master)
39-
CHANGES_SINCE_LAST_RELEASE="$CHANGES_SINCE_LAST_RELEASE" | xargs echo -n
40-
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" || -z $LAST_RELEASE]]; then
41-
echo "There are changes since last release. Releasing $1";
35+
if [[ -z "$LAST_RELEASE" ]]; then
36+
echo "There has not been any releases. Releasing $1";
4237

4338
git tag $1 -s -m "Release $1"
4439
git push origin --tags
4540
else
46-
echo "No change since last release.";
41+
echo "Last release $LAST_RELEASE";
42+
43+
CHANGES_SINCE_LAST_RELEASE=$(git log "$LAST_RELEASE"...master)
44+
CHANGES_SINCE_LAST_RELEASE="$CHANGES_SINCE_LAST_RELEASE" | xargs echo -n
45+
if [[ ! -z "$CHANGES_SINCE_LAST_RELEASE" ]]; then
46+
echo "There are changes since last release. Releasing $1";
47+
48+
git tag $1 -s -m "Release $1"
49+
git push origin --tags
50+
else
51+
echo "No change since last release.";
52+
fi
4753
fi
4854
)
4955
done

0 commit comments

Comments
 (0)