@@ -35,6 +35,11 @@ function error() {
35
35
return 1
36
36
}
37
37
38
+ function skip() {
39
+ echo " 👌 SKIPPED."
40
+ exit 0
41
+ }
42
+
38
43
function get_current_version() {
39
44
local version=" "
40
45
if [[ -f $properties ]]; then
@@ -66,6 +71,12 @@ function replace() {
66
71
function diff_link() {
67
72
echo -n " $github_repository_url /compare/${1} ...${2} "
68
73
}
74
+
75
+ function wait_confirmation() {
76
+ local input
77
+ read -p " Enter 'yes' to continue: " -r input
78
+ [[ $input == " yes" ]]
79
+ }
69
80
# endregion
70
81
71
82
# Check if the module exists
@@ -74,8 +85,8 @@ function diff_link() {
74
85
# 0. Fetch remote changes
75
86
echo " ️⏳ Creating release branch..."
76
87
release_branch=" release/$release "
77
- git checkout --quiet -b " $release_branch "
78
- git pull --quiet --rebase origin main
88
+ git checkout --quiet -B " $release_branch "
89
+ git pull --quiet --rebase origin main || wait_confirmation || skip
79
90
echo " ✅ Branch '$release_branch ' created"
80
91
echo
81
92
@@ -84,7 +95,7 @@ last_version=$(get_current_version)
84
95
version=${release##* -v} # library-v1.0.0 -> 1.0.0
85
96
if [[ " $last_version " == " $version " ]]; then
86
97
echo " 🤔 Version $version is already set."
87
- exit 0
98
+ wait_confirmation || skip
88
99
fi
89
100
echo " 🚀 [$module ] Update $last_version → $version "
90
101
echo
@@ -112,16 +123,12 @@ echo "✅ Updated CHANGELOG.md header"
112
123
echo
113
124
echo " Do you want to commit the changes and push the release branch and tag?"
114
125
echo " The release tag push triggers a release workflow on CI."
115
- read -p " Enter 'yes' to continue: " -r input
116
- if [[ " $input " != " yes" ]]; then
117
- echo " 👌 SKIPPED."
118
- exit 0
119
- fi
126
+ wait_confirmation || skip
120
127
121
128
# 5. Push changes, trigger release on CI, and give a link to open PR
122
129
echo
123
130
echo " ⏳ Pushing the changes to the remote repository..."
124
- git add " $readme " " $changelog " " $properties " " $build_script "
131
+ git add " $module_path "
125
132
git commit --quiet --message " $library : $version "
126
133
git tag " $release "
127
134
git push --quiet origin HEAD " $release "
0 commit comments