fix relative path in menu.py

This commit is contained in:
aik2 2022-07-25 14:31:12 +04:00
parent d7f107c352
commit 1cd5befbf3

View File

@ -15,12 +15,13 @@ class mount(Command):
Show menu to mount and unmount
"""
def execute(self):
""" Show menu to mount and unmount """
(f, p) = tempfile.mkstemp()
os.close(f)
self.fm.execute_console(f"shell python3 {os.getcwd()}/menu.py {p}")
self.fm.execute_console(
f"shell python3 {os.path.dirname(os.path.realpath(__file__))}/menu.py {p}"
)
with open(p, 'r') as f:
d = f.readline()
if os.path.exists(d):