From fa926e876485dfe81b288ac3ee8025c2c7f59895 Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 10 Sep 2014 18:12:30 -0400 Subject: Throw error when JASPER_HOME is not set in start.py --- client/main.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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): -- cgit v1.3.1