Skip to content

Commit e76a331

Browse files
committed
fix the bash script to do as expected with the prompt
1 parent 4826522 commit e76a331

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

generate_api_docs.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,18 @@ mv build/docs/api/py docs/api/py
1414

1515
git add -A docs/api
1616

17-
echo "Do you want to commit the changes? (Y/n):"
17+
read -p "Do you want to commit the chages? (Y/n):" changes </dev/tty
1818

19-
read changes
20-
21-
if [ $changes != "" || $changes != "Y" || $changes != "y" ]
22-
then
23-
exit;
19+
if [ -z $changes ]; then
20+
changes=Y
2421
fi
2522

23+
case "$changes" in
24+
Y|y) echo "";;
25+
N|n) exit;;
26+
*) exit;;
27+
esac
28+
2629
echo "Commiting changes"
2730
git commit -am "updating javadoc and py docs"
2831

0 commit comments

Comments
 (0)