summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
Diffstat (limited to 'client')
-rwxr-xr-xclient/main.py11
-rwxr-xr-xclient/start.sh6
2 files changed, 14 insertions, 3 deletions
diff --git a/client/main.py b/client/main.py
index 6683188..d57acd7 100755
--- a/client/main.py
+++ b/client/main.py
@@ -1,5 +1,16 @@
#!/usr/bin/env python2
# -*- coding: utf-8-*-
+
+import os
+import shutil
+
+# Change CWD to $JASPER_HOME/jasper/client
+os.chdir(os.path.join(os.getenv("JASPER_HOME"), "jasper", "client"))
+
+old_client = os.path.abspath(os.path.join(os.pardir, "old_client"))
+if os.path.exists(old_client):
+ shutil.rmtree(old_client)
+
import yaml
import sys
import speaker
diff --git a/client/start.sh b/client/start.sh
index 052db18..cde8d8d 100755
--- a/client/start.sh
+++ b/client/start.sh
@@ -1,4 +1,4 @@
#!/bin/bash
-cd $JASPER_HOME/jasper/client
-rm -rf ../old_client
-./main.py &
+# This file exists for backwards compatibility with older versions of Jasper.
+# It might be removed in future versions.
+"${0%/*}/main.py"