Fix starting skillstest via start-mycroft.sh
This also removes the ability to pass the skills dir as the first argument. Instead this was moved to an environment variable called SKILLS_DIR to prevent conflict with pytest arguments
@@ -17,7 +17,6 @@ import pytest
import glob
import os
from os.path import exists, join, expanduser
-import sys
import imp
from mycroft.configuration import Configuration
@@ -64,11 +63,13 @@ def discover_tests(skills_dir):
def get_skills_dir():
- if len(sys.argv) > 1:
- return expanduser(sys.argv[-1])
-
- return expanduser(join(Configuration.get()['data_dir'],
- Configuration.get()['skills']['msm']['directory']))
+ return (
+ expanduser(os.environ.get('SKILLS_DIR', '')) or
+ expanduser(join(
+ Configuration.get()['data_dir'],
+ Configuration.get()['skills']['msm']['directory']
+ ))
+ )
skills_dir = get_skills_dir()
