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

Commit0920371

Browse files
committed
Extract suggest_venv out of the else block
I think this is easier to read, but this is admittedly subjective.This commit also makes the separate change of adjusting commentspacing for consistency within the script. (Two spaces before "#"is not widely regarded as better than one in shell scripting, sounlike Python where PEP-8 recommends that, it would be equally goodto have changed all the other places in the shell scrips to havejust one.)
1 parent21875b5 commit0920371

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎build-release.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@ function release_with() {
99
"$1" -m build --sdist --wheel
1010
}
1111

12+
functionsuggest_venv() {
13+
local venv_cmd='python -m venv env && source env/bin/activate'
14+
printf"HELP: To avoid this error, use a virtual-env with '%s' instead.\n""$venv_cmd"
15+
}
16+
1217
iftest -n"${VIRTUAL_ENV:-}";then
1318
deps=(build twine)# Install twine along with build, as we need it later.
1419
echo"Virtual environment detected. Adding packages:${deps[*]}"
1520
pip install --quiet --upgrade"${deps[@]}"
1621
echo'Starting the build.'
1722
release_with python
1823
else
19-
functionsuggest_venv() {
20-
venv_cmd='python -m venv env && source env/bin/activate'
21-
printf"HELP: To avoid this error, use a virtual-env with '%s' instead.\n""$venv_cmd"
22-
}
2324
trap suggest_venv ERR# This keeps the original exit (error) code.
2425
echo'Starting the build.'
25-
release_with python3# Outside a venv, use python3.
26+
release_with python3# Outside a venv, use python3.
2627
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp