Skip to content

Commit

Permalink
tty change
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Loftus committed Dec 10, 2024
1 parent d393c4d commit 6c82e0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ def up(local: bool, debug: bool):
"""Run the docker swarm stack"""

if not os.path.exists(".env"):
print("Missing .env file. Do you want to copy .env.example to .env ? (y/n)")
# check if you are running in a terminal or in CI/CD
if not sys.stdin.isatty():
shutil.copy(".env.example", ".env")
else:
answer = input().lower()
answer = input(
"Missing .env file. Do you want to copy .env.example to .env ? (y/n)"
).lower()
if answer == "y" or answer == "yes":
print("Copying .env.example to .env")
shutil.copy(".env.example", ".env")
else:
print("Missing .env file. Exiting")
Expand Down

0 comments on commit 6c82e0c

Please sign in to comment.