diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-10 18:12:30 -0400 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2014-09-10 18:12:30 -0400 |
| commit | fa926e876485dfe81b288ac3ee8025c2c7f59895 (patch) | |
| tree | 26c0b0f98ed0de7a3b9d72d00f12403c830497ff /client | |
| parent | 757bfb7a62105eebe37aa846f9fd0cbea4a4187c (diff) | |
| download | jasper-client-fa926e876485dfe81b288ac3ee8025c2c7f59895.tar.gz jasper-client-fa926e876485dfe81b288ac3ee8025c2c7f59895.zip | |
Throw error when JASPER_HOME is not set in start.py
Diffstat (limited to 'client')
| -rwxr-xr-x | client/main.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/client/main.py b/client/main.py index d57acd7..7167c95 100755 --- a/client/main.py +++ b/client/main.py @@ -2,10 +2,16 @@ # -*- coding: utf-8-*- import os +import sys import shutil # Change CWD to $JASPER_HOME/jasper/client -os.chdir(os.path.join(os.getenv("JASPER_HOME"), "jasper", "client")) +jasper_home = os.getenv("JASPER_HOME") +if not jasper_home or not os.path.exists(jasper_home): + print("Error: $JASPER_HOME is not set.") + sys.exit(0) + +os.chdir(os.path.join(jasper_home, "jasper", "client")) old_client = os.path.abspath(os.path.join(os.pardir, "old_client")) if os.path.exists(old_client): |
