mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
zulip_tools.py: Add get_environment() function.
This function can be used to determine the environment in which a script is being executed.
This commit is contained in:
committed by
Tim Abbott
parent
4825b6e5ad
commit
931e4752aa
@@ -147,3 +147,11 @@ def log_management_command(cmd, log_path):
|
||||
logger.setLevel(logging.INFO)
|
||||
|
||||
logger.info("Ran '%s'" % (cmd,))
|
||||
|
||||
def get_environment():
|
||||
# type: () -> Text
|
||||
if os.path.exists(DEPLOYMENTS_DIR):
|
||||
return "prod"
|
||||
if os.environ.get("TRAVIS"):
|
||||
return "travis"
|
||||
return "dev"
|
||||
|
||||
Reference in New Issue
Block a user