Skip to content

Commit f6dbba2

Browse files
committed
A couple more script tweaks for clarity
- Because the substitition string after the hyphen is empty, "${VIRTUAL_ENV:-}" and "${VIRTUAL_ENV-}" have the same effect. However, the latter, which this changes it to, expresses the correct idea that the special case being handled is when the variable is unset: in this case, we expand an empty field rather than triggering an error due to set -u. When the variable is set but empty, it already expands to the substitution value, and including that in the special case with ":" is thus misleading. - Continuing in the vein of d18d90a (and 1e0b3f9), this removes another explicit newline by adding another echo command to print the leading blank line before the table.
1 parent c7cdaf4 commit f6dbba2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Diff for: build-release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function suggest_venv() {
1414
printf "HELP: To avoid this error, use a virtual-env with '%s' instead.\n" "$venv_cmd"
1515
}
1616

17-
if test -n "${VIRTUAL_ENV:-}"; then
17+
if test -n "${VIRTUAL_ENV-}"; then
1818
deps=(build twine) # Install twine along with build, as we need it later.
1919
echo "Virtual environment detected. Adding packages: ${deps[*]}"
2020
pip install --quiet --upgrade "${deps[@]}"

Diff for: check-version.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ head_sha="$(git rev-parse HEAD)"
4141
latest_tag_sha="$(git rev-parse "${latest_tag}^{commit}")"
4242

4343
# Display a table of all the current version, tag, and HEAD commit information.
44-
echo $'\nThe VERSION must be the same in all locations, and so must the HEAD and tag SHA'
44+
echo
45+
echo 'The VERSION must be the same in all locations, and so must the HEAD and tag SHA'
4546
printf '%-14s = %s\n' 'VERSION file' "$version_version" \
4647
'changes.rst' "$changes_version" \
4748
'Latest tag' "$latest_tag" \

0 commit comments

Comments
 (0)