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

Commit1e0b3f9

Browse files
committed
refinements tobuild-reelase.sh
- use `echo` where feasible to avoid explicit newlines- use `function` syntax out of habit- deduplicate release invocation- make `venv` based invocation less verbose- make help-text in non-venv more prominent
1 parent5919f8d commit1e0b3f9

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

‎build-release.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55

66
set -eEu
77

8+
functionrelease_with() {
9+
$1 -m build --sdist --wheel
10+
}
11+
812
iftest -n"${VIRTUAL_ENV:-}";then
913
deps=(build twine)# Install twine along with build, as we need it later.
10-
printf'Virtual environment detected. Adding packages:%s\n'"${deps[*]}"
11-
pip install -U"${deps[@]}"
12-
printf'Starting the build.\n'
13-
python -m build --sdist --wheel
14+
echo"Virtual environment detected. Adding packages:${deps[*]}"
15+
pip install --quiet --upgrade"${deps[@]}"
16+
echo'Starting the build.'
17+
release_with python
1418
else
15-
suggest_venv() {
19+
functionsuggest_venv() {
1620
venv_cmd='python -m venv env && source env/bin/activate'
17-
printf"Use a virtual-env with '%s' instead.\n""$venv_cmd"
21+
printf"HELP: To avoid this error, use a virtual-env with '%s' instead.\n""$venv_cmd"
1822
}
1923
trap suggest_venv ERR# This keeps the original exit (error) code.
20-
printf'Starting the build.\n'
21-
python3 -m build --sdist --wheel# Outside a venv, use python3.
24+
echo'Starting the build.'
25+
release_with python3# Outside a venv, use python3.
2226
fi

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp