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
pull/1619/head
Matthew D. Scholefield 2018-05-31 19:17:26 -05:00
parent 7624b33d5e
commit cc582ce38c
1 changed files with 7 additions and 6 deletions

View File

@ -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()