Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite973f52

Browse files
committed
Use some handy bash-isms in version check script
The script is nonportable to other shells already because of itsuse of trap (and other features, such as implicit assumptions madeabout echo, and the function keyword), which its hashbang alreadyclearly conveys.This uses:- $(<X) in place of $(cat X), to have the shell read the file directly rather than using cat.- printf -v in one place to set a variable rather than printing. This eliminates a command substitution that was harder to read.
1 parent0920371 commite973f52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎check-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ readonly changes_path='doc/source/changes.rst'
1212

1313
functionget_latest_tag() {
1414
local config_opts
15-
config_opts="$(printf' -c versionsort.suffix=-%s' alpha beta pre rc RC)"
15+
printf-v config_opts' -c versionsort.suffix=-%s' alpha beta pre rc RC
1616
# shellcheck disable=SC2086 # Deliberately word-splitting the arguments.
1717
git$config_opts tag -l'[0-9]*' --sort=-v:refname| head -n1
1818
}
@@ -31,7 +31,7 @@ echo 'Checking that ALL changes are committed.'
3131
git status -s --ignore-submodules
3232
test -z"$(git status -s --ignore-submodules)"
3333

34-
version_version="$(cat"$version_path")"
34+
version_version="$(<"$version_path")"
3535
changes_version="$(awk'/^[0-9]/ {print $0; exit}'"$changes_path")"
3636
latest_tag="$(get_latest_tag)"
3737
head_sha="$(git rev-parse HEAD)"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp