cleaned up the code

This commit is contained in:
Nek-12 2020-07-16 20:49:15 +03:00
parent 829335a739
commit 638db2dbf6
2 changed files with 5 additions and 8 deletions

View File

@ -56,8 +56,8 @@ try:
f' * {os.path.join(filepath, "app.asar.bak")} was not found: step skipped.')
if sys.platform == 'linux' and 'microsoft' not in platform.uname()[3].lower():
pathlist = ['/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app']
# get all the possible paths where the launcher may be located
pathlist = ('/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app')
# check all the possible paths where the launcher may be located
for path in pathlist:
if os.path.exists(path):
with open(path, 'r', encoding='UTF-8') as launcher:

View File

@ -224,15 +224,12 @@ try:
f' * {os.path.join(filepath, "app", "main", "main.js")} was not found: step skipped.')
if sys.platform == 'linux' and 'microsoft' not in platform.uname()[3].lower():
def patch(dest):
print(f' ...patching app launcher in {path}')
subprocess.call(['sed', '-i', r's/electron6\ app\.asar/electron6\ app/', dest])
pathlist = ['/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app']
pathlist = ('/usr/bin/notion-app', '/usr/bin/notion', '/opt/notion-app/notion-app')
# check all the paths where the launcher may be located
for path in pathlist:
if os.path.exists(path):
patch(path)
print(f' ...patching app launcher in {path}')
subprocess.call(['sed', '-i', r's/electron6\ app\.asar/electron6\ app/', path])
print('\n>>> SUCCESSFULLY CUSTOMISED <<<')