mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-10 15:39:01 +00:00
Fixed the error which caused wrong bahavior of app launcher patcherin the cleaner.py, updated to comply with new location and launcher script
This commit is contained in:
parent
cb9aa3ed5c
commit
6e1d9e9516
20
cleaner.py
20
cleaner.py
@ -57,15 +57,23 @@ 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():
|
||||
bin_path = '/usr/bin/notion-app' if os.path.exists(
|
||||
'/usr/bin/notion-app') else '/usr/bin/notion'
|
||||
with open(bin_path, 'r', encoding='UTF-8') as launcher:
|
||||
if 'app.asar' not in launcher:
|
||||
path = ''
|
||||
if os.path.exists('/opt/notion-app/notion-app'):
|
||||
path = '/opt/notion-app/notion-app'
|
||||
elif os.path.exists('/usr/bin/notion-app'):
|
||||
path = '/usr/bin/notion-app'
|
||||
elif os.path.exists('/usr/bin/notion'):
|
||||
path = '/usr/bin/notion'
|
||||
else:
|
||||
raise ValueError("Couldn't find the app launcher")
|
||||
with open(path, 'r', encoding='UTF-8') as launcher:
|
||||
contents = launcher.read()
|
||||
if 'app.asar' not in contents:
|
||||
print(
|
||||
f' ...patching app launcher')
|
||||
subprocess.call(
|
||||
['sed', '-i', r's/electron\ app/electron\ app\.asar/',
|
||||
bin_path])
|
||||
['sed', '-i', r's/electron6\ app/electron6\ app\.asar/',
|
||||
path])
|
||||
|
||||
print(f'\n{bold}>>> SUCCESSFULLY CLEANED <<<{normal}')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user