Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add requirements #38

Merged
merged 6 commits into from
May 12, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions terrabutler/requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
def check_requirements():
"""
Check requirements before running the application.
"""
from os import getenv, path
from colorama import Fore

if getenv("TERRABUTLER_ENABLE") != "true":
print(Fore.YELLOW + "Terrabutler is running outside of a project"
" folder or Please set 'TERRABUTLER_ENABLE' in your environment."
"\nExiting...")
exit(1)
root = getenv("TERRABUTLER_ROOT")
if root is None or not path.exists(root):
print(Fore.RED + "Terrabutler can't determine the root folder of"
" your project or it doesn't exist.\nPlease set"
" 'TERRABUTLER_ROOT' in your environment pointing"
" to the root folder of your project.")
exit(1)