fix variable scope

This commit is contained in:
Rudis Muiznieks 2022-02-08 15:22:26 -06:00
parent b5764124ca
commit 551114e9f6
Signed by: rudism
GPG Key ID: CABF2F86EF7884F9
2 changed files with 3 additions and 3 deletions

View File

@ -16,8 +16,8 @@ class RunScriptSkill(MycroftSkill):
self.read_scripts_dir()
def read_scripts_dir(self):
if os.path.isdir(self.script_dir):
self.scripts = os.listdir(script_dir)
if self.script_dir and os.path.isdir(self.script_dir):
self.scripts = os.listdir(self.script_dir)
else:
self.log.critical("The script_dir directory does not exist or can't be read")
self.scripts = []

View File

@ -6,7 +6,7 @@
"name": "script_dir",
"type": "text",
"label": "Directory containing scripts",
"value": "/home/pi/scripts"
"value": "/home/mycroft/scripts"
}]
}]
}