Skip to content

Commit 98d4f4e

Browse files
author
Brandon Sneed
committed
Version 1.0.2
1 parent 0c3d3fe commit 98d4f4e

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

Sources/Segment/Version.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
// Use release.sh's automation.
1616

1717
// BREAKING.FEATURE.FIX
18-
internal let __segment_version = "1.0.1"
18+
internal let __segment_version = "1.0.2"

release.sh

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,19 @@ then
3939
exit 1
4040
fi
4141

42+
# check if `gh` tool has auth access.
43+
# command will return non-zero if not auth'd.
44+
authd=$(gh auth status -t)
45+
if [[ $? != 0 ]]; then
46+
echo "ex: $ gh auth login"
47+
exit 1
48+
fi
49+
4250
# check that we're on the `main` branch
4351
branch=$(git rev-parse --abbrev-ref HEAD)
44-
if [ branch != 'main' ]
52+
if [ $branch != 'main' ]
4553
then
46-
echo "The 'main' branch must be the current branch out to make a release."
54+
echo "The 'main' must be the current branch to make a release."
4755
echo "You are currently on: $branch"
4856
exit 1
4957
fi
@@ -70,8 +78,7 @@ then
7078
fi
7179

7280
newVersion="${1%.*}.$((${1##*.}))"
73-
echo "$version"
74-
echo "$newVersion"
81+
echo "Preparing to release $newVersion..."
7582

7683
vercomp $newVersion $version
7784
case $? in
@@ -86,12 +93,21 @@ then
8693
exit 1
8794
fi
8895

96+
read -r -p "Are you sure you want to release $newVersion? [y/N] " response
97+
case "$response" in
98+
[yY][eE][sS]|[yY])
99+
;;
100+
*)
101+
exit 1
102+
;;
103+
esac
104+
89105
# get the commits since the last release...
90106
# note: we do this here so the "Version x.x.x" commit doesn't show up in logs.
91-
changelog=git log --pretty=format:"- (%an) %s" $(git describe --tags --abbrev=0 @^)..@
107+
changelog=$(git log --pretty=format:"- (%an) %s" $(git describe --tags --abbrev=0 @^)..@)
92108
tempFile=$(mktemp)
93109
#write changelog to temp file.
94-
echo $changelog >> $tempFile
110+
echo -e "$changelog" >> $tempFile
95111

96112
# update sources/Segment/Version.swift
97113
# - remove last line...

0 commit comments

Comments
 (0)