This repository was archived by the owner on May 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +50
-50
lines changed Expand file tree Collapse file tree 2 files changed +50
-50
lines changed Original file line number Diff line number Diff line change 22set -euo pipefail
33
44usage () {
5- cat << EOF
5+ cat << EOF
66Usage: $0 [OPTIONS] [<MODULE> <VERSION>]
77
88Create annotated git tags for module releases.
2828
2929check_getopt () {
3030 # Check if we have GNU or BSD getopt.
31- if getopt --test > /dev/null 2>&1 ; then
31+ if getopt --test > /dev/null 2>&1 ; then
3232 # Exit status 4 means GNU getopt is available.
3333 if [[ $? -ne 4 ]]; then
3434 echo " Error: GNU getopt is not available." >&2
@@ -50,10 +50,10 @@ maybe_dry_run() {
5050}
5151
5252get_readme_version () {
53- grep -o ' version *= *"[0-9]\+\.[0-9]\+\.[0-9]\+"' " $1 " |
54- head -1 |
55- grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+' ||
56- echo " 0.0.0"
53+ grep -o ' version *= *"[0-9]\+\.[0-9]\+\.[0-9]\+"' " $1 " \
54+ | head -1 \
55+ | grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+' \
56+ || echo " 0.0.0"
5757}
5858
5959list_modules () {
@@ -131,29 +131,29 @@ eval set -- "$temp"
131131
132132while true ; do
133133 case " $1 " in
134- -l | --list)
135- list=true
136- shift
137- ;;
138- -d | --dry-run)
139- dry_run=true
140- shift
141- ;;
142- -p | --push)
143- push=true
144- shift
145- ;;
146- -h | --help)
147- usage
148- ;;
149- --)
150- shift
151- break
152- ;;
153- * )
154- echo " Error: Internal error!" >&2
155- exit 1
156- ;;
134+ -l | --list)
135+ list=true
136+ shift
137+ ;;
138+ -d | --dry-run)
139+ dry_run=true
140+ shift
141+ ;;
142+ -p | --push)
143+ push=true
144+ shift
145+ ;;
146+ -h | --help)
147+ usage
148+ ;;
149+ --)
150+ shift
151+ break
152+ ;;
153+ * )
154+ echo " Error: Internal error!" >&2
155+ exit 1
156+ ;;
157157 esac
158158done
159159
@@ -178,7 +178,7 @@ if ! tag_name=$(get_tag_name "$module" "$version"); then
178178 exit 1
179179fi
180180
181- if git rev-parse -q --verify " refs/tags/$tag_name " > /dev/null 2>&1 ; then
181+ if git rev-parse -q --verify " refs/tags/$tag_name " > /dev/null 2>&1 ; then
182182 echo " Notice: Tag '$tag_name ' already exists" >&2
183183else
184184 maybe_dry_run git tag -a " $tag_name " -m " Release $module v$version "
Original file line number Diff line number Diff line change 22set -euo pipefail
33
44usage () {
5- cat << EOF
5+ cat << EOF
66Usage: $0 [OPTIONS] <MODULE> <VERSION>
77
88Update or check the version in a module's README.md file.
@@ -63,14 +63,14 @@ update_version() {
6363
6464 print
6565 }
66- ' " $file " > " $tmpfile " && mv " $tmpfile " " $file "
66+ ' " $file " > " $tmpfile " && mv " $tmpfile " " $file "
6767}
6868
6969get_readme_version () {
70- grep -o ' version *= *"[0-9]\+\.[0-9]\+\.[0-9]\+"' " $1 " |
71- head -1 |
72- grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+' ||
73- echo " 0.0.0"
70+ grep -o ' version *= *"[0-9]\+\.[0-9]\+\.[0-9]\+"' " $1 " \
71+ | head -1 \
72+ | grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+' \
73+ || echo " 0.0.0"
7474}
7575
7676# Set defaults.
@@ -79,20 +79,20 @@ check_only=false
7979# Parse command-line options.
8080while [[ $# -gt 0 ]]; do
8181 case " $1 " in
82- -c | --check)
83- check_only=true
84- shift
85- ;;
86- -h | --help)
87- usage 0
88- ;;
89- -* )
90- echo " Error: Unknown option: $1 " >&2
91- usage 1
92- ;;
93- * )
94- break
95- ;;
82+ -c | --check)
83+ check_only=true
84+ shift
85+ ;;
86+ -h | --help)
87+ usage 0
88+ ;;
89+ -* )
90+ echo " Error: Unknown option: $1 " >&2
91+ usage 1
92+ ;;
93+ * )
94+ break
95+ ;;
9696 esac
9797done
9898
You can’t perform that action at this time.
0 commit comments