Use create_subprocess_shell and fix hosts file appending on Linux
This commit is contained in:
parent
44cdf424dc
commit
992048ede3
2
setup.py
2
setup.py
@ -9,7 +9,7 @@ README = (HERE / "README.md").read_text()
|
|||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='worthless',
|
name='worthless',
|
||||||
version='1.2.9-2',
|
version='1.2.9-3',
|
||||||
packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'],
|
packages=['worthless', 'worthless.classes', 'worthless.classes.launcher', 'worthless.classes.installer'],
|
||||||
url='https://git.froggi.es/tretrauit/worthless-launcher',
|
url='https://git.froggi.es/tretrauit/worthless-launcher',
|
||||||
license='MIT License',
|
license='MIT License',
|
||||||
|
@ -26,11 +26,11 @@ class LinuxUtils:
|
|||||||
"""
|
"""
|
||||||
if isinstance(file_path, Path):
|
if isinstance(file_path, Path):
|
||||||
file_path = str(file_path)
|
file_path = str(file_path)
|
||||||
await self._exec_command('pkexec echo {} > {}'.format(text, file_path))
|
await self._exec_command('echo -e "{}" | pkexec tee {}'.format(text, file_path))
|
||||||
|
|
||||||
async def append_text_to_file(self, text, file_path: str | Path):
|
async def append_text_to_file(self, text, file_path: str | Path):
|
||||||
"""Append text to a file using pkexec (friendly gui)
|
"""Append text to a file using pkexec (friendly gui)
|
||||||
"""
|
"""
|
||||||
if isinstance(file_path, Path):
|
if isinstance(file_path, Path):
|
||||||
file_path = str(file_path)
|
file_path = str(file_path)
|
||||||
await self._exec_command('pkexec echo {} >> {}'.format(text, file_path))
|
await self._exec_command('echo -e "{}" | pkexec tee -a {}'.format(text, file_path))
|
||||||
|
@ -128,7 +128,7 @@ class Patcher:
|
|||||||
telemetry = await self.is_telemetry_blocked()
|
telemetry = await self.is_telemetry_blocked()
|
||||||
if not telemetry:
|
if not telemetry:
|
||||||
raise ValueError("All telemetry are blocked")
|
raise ValueError("All telemetry are blocked")
|
||||||
telemetry_hosts = ""
|
telemetry_hosts = "\n"
|
||||||
for url in telemetry:
|
for url in telemetry:
|
||||||
telemetry_hosts += "0.0.0.0 " + url + "\n"
|
telemetry_hosts += "0.0.0.0 " + url + "\n"
|
||||||
match platform.system():
|
match platform.system():
|
||||||
|
Loading…
Reference in New Issue
Block a user