Skip to content

Commit

Permalink
Fix #1009
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Apr 4, 2020
1 parent 704d92d commit 43878b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion custom_components/hacs/repositories/repository.py
Expand Up @@ -402,6 +402,12 @@ async def remove_local_directory(self):
if self.data.category == "python_script":
local_path = "{}/{}.py".format(self.content.path.local, self.data.name)
elif self.data.category == "theme":
if os.path.exists(
f"{self.hacs.system.config_path}/{self.hacs.configuration.theme_path}/{self.data.name}.yaml"
):
os.remove(
f"{self.hacs.system.config_path}/{self.hacs.configuration.theme_path}/{self.data.name}.yaml"
)
local_path = "{}/{}.yaml".format(
self.content.path.local, self.data.name
)
Expand All @@ -411,7 +417,7 @@ async def remove_local_directory(self):
if os.path.exists(local_path):
self.logger.debug(f"Removing {local_path}")

if self.data.category in ["python_script", "theme"]:
if self.data.category in ["python_script"]:
os.remove(local_path)
else:
shutil.rmtree(local_path)
Expand Down

0 comments on commit 43878b4

Please sign in to comment.