File tree Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Expand file tree Collapse file tree 2 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 15
15
// Use release.sh's automation.
16
16
17
17
// BREAKING.FEATURE.FIX
18
- internal let __segment_version = " 1.0.1 "
18
+ internal let __segment_version = " 1.0.2 "
Original file line number Diff line number Diff line change 39
39
exit 1
40
40
fi
41
41
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
+
42
50
# check that we're on the `main` branch
43
51
branch=$( git rev-parse --abbrev-ref HEAD)
44
- if [ branch != ' main' ]
52
+ if [ $ branch != ' main' ]
45
53
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."
47
55
echo " You are currently on: $branch "
48
56
exit 1
49
57
fi
70
78
fi
71
79
72
80
newVersion=" ${1% .* } .$(( ${1##* .} )) "
73
- echo " $version "
74
- echo " $newVersion "
81
+ echo " Preparing to release $newVersion ..."
75
82
76
83
vercomp $newVersion $version
77
84
case $? in
86
93
exit 1
87
94
fi
88
95
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
+
89
105
# get the commits since the last release...
90
106
# 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 @^) ..@)
92
108
tempFile=$( mktemp)
93
109
# write changelog to temp file.
94
- echo $changelog >> $tempFile
110
+ echo -e " $changelog " >> $tempFile
95
111
96
112
# update sources/Segment/Version.swift
97
113
# - remove last line...
You can’t perform that action at this time.
0 commit comments