-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version_increment.sh
executable file
·38 lines (35 loc) · 1.07 KB
/
version_increment.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Use /dev/tty para garantir que a entrada seja lida do terminal
read -r -p "Increment Version? (s/N): " response </dev/tty
if [[ "$response" =~ ^([sS][iI][mM]|[sS])$ ]]; then
echo "Choose an option to increment the version:"
echo "1) Major"
echo "2) Minor"
echo "3) Patch"
read -r -p "Enter your choice (1/2/3): " choice </dev/tty
case $choice in
1)
poetry version major
git add pyproject.toml
git commit -m "chore: increase major version"
echo "Incremented Major Version and pyproject.toml added for commit."
;;
2)
poetry version minor
git add pyproject.toml
git commit -m "chore: increase minor version"
echo "Incremented Minor Version and pyproject.toml added for commit."
;;
3)
poetry version patch
git add pyproject.toml
git commit -m "chore: increase patch version"
echo "Incremented Patch Version and pyproject.toml added for commit."
;;
*)
echo "Invalid choice. Version not incremented."
;;
esac
else
echo "Version not incremented."
fi