Skip to content

Commit 964c2d3

Browse files
committed
Docker build files & setup
1 parent 814027b commit 964c2d3

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

docker_setup.sh

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/bin/bash
22

3-
function hzline() {
4-
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - ;
5-
}
3+
# horizontal line
4+
function hzline() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - ; }
65

76
# Check if Docker is installed
87
if ! [ -x "$(command -v docker)" ]; then
@@ -18,6 +17,19 @@ echo "::: Source code & repo: https://github.com/FlyingFathead/TelegramBot-OpenA
1817
hzline &&
1918
echo
2019

20+
# Check if .env file already exists and prompt the user
21+
if [ -f .env ]; then
22+
echo "Warning: A .env file already exists in this directory."
23+
while true; do
24+
read -p "Do you want to overwrite the existing .env file? (y/n): " yn
25+
case $yn in
26+
[Yy]* ) break;;
27+
[Nn]* ) echo "Exiting setup without overwriting .env file."; exit 0;;
28+
* ) echo "Please answer yes or no.";;
29+
esac
30+
done
31+
fi
32+
2133
# Function to check for empty or invalid inputs for required keys
2234
validate_input() {
2335
if [[ -z "$1" || ${#1} -lt 10 ]]; then

0 commit comments

Comments
 (0)