[wgem] fix when ~/.local/share/applications does not exist

This commit is contained in:
Vinícius Moreira
2019-12-13 19:06:38 -03:00
parent cdff6696eb
commit a3c35ff08a
2 changed files with 4 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ from bauh.api.abstract.handler import ProcessWatcher
from bauh.api.abstract.model import SoftwarePackage, PackageAction, PackageSuggestion, PackageUpdate, PackageHistory
from bauh.api.abstract.view import MessageType, MultipleSelectComponent, InputOption, SingleSelectComponent, \
SelectViewType, TextInputComponent, FormComponent
from bauh.api.constants import HOME_PATH
from bauh.api.constants import HOME_PATH, DESKTOP_ENTRIES_DIR
from bauh.commons.html import bold
from bauh.commons.system import ProcessHandler, get_dir_size, get_human_size_str
from bauh.gems.web import INSTALLED_PATH, nativefier, DESKTOP_ENTRY_PATH_PATTERN, URL_FIX_PATTERN
@@ -396,6 +396,8 @@ class WebApplicationManager(SoftwareManager):
entry_content = self._gen_desktop_entry_content(pkg)
Path(DESKTOP_ENTRIES_DIR).mkdir(parents=True, exist_ok=True)
with open(desktop_entry_path, 'w+') as f:
f.write(entry_content)