mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
Fix: AUR installation when '.local/share/applications' does not exist
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
# used for AUR installation
|
# used for AUR installation
|
||||||
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -12,7 +13,12 @@ Exec = /usr/bin/fpakman
|
|||||||
Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/flathub_45.svg
|
Icon = /usr/lib/python{version}/site-packages/fpakman/resources/img/flathub_45.svg
|
||||||
""".format(version="{}.{}".format(sys.version_info.major, sys.version_info.minor))
|
""".format(version="{}.{}".format(sys.version_info.major, sys.version_info.minor))
|
||||||
|
|
||||||
file_path = '{}/.local/share/applications/fpakman.desktop'.format(str(Path.home()))
|
apps_path = '{}/.local/share/applications'.format(str(Path.home()))
|
||||||
|
|
||||||
|
if not os.path.exists(apps_path):
|
||||||
|
os.mkdir(apps_path)
|
||||||
|
|
||||||
|
file_path = apps_path + '/fpakman.desktop'
|
||||||
|
|
||||||
with open(file_path, 'w+') as f:
|
with open(file_path, 'w+') as f:
|
||||||
f.write(desktop_file)
|
f.write(desktop_file)
|
||||||
Reference in New Issue
Block a user