Skip to content

Commit 751acfd

Browse files
committed
build(release): use venv hatchling, install if it is not present
1 parent 531268a commit 751acfd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

scripts/release.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ cd "$(dirname "$(dirname "$0")")" || {
1515
exit 1
1616
}
1717

18-
hatch version "$1"
19-
version=$(hatch version)
18+
if [ ! -x ./.venv/bin/hatchling ]; then
19+
read -r -p "Hatchling is not installed. Install it? [y/N]: " response
20+
response=${response,,}
21+
response=${response// /}
22+
23+
if [ "$response" = "y" ]; then
24+
rye sync
25+
else
26+
echo "Exiting." >&2
27+
exit 1
28+
fi
29+
fi
30+
31+
./.venv/bin/hatchling version "$1"
32+
version=$(./.venv/bin/hatchling version)
2033

2134
git add --verbose --all
2235
git commit --verbose --message="chore: bump version to $version"

0 commit comments

Comments
 (0)