diff options
| author | botato <63275405+botatooo@users.noreply.github.com> | 2022-07-11 02:56:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-11 08:56:36 +0200 |
| commit | 76424174edfb330eecdf2d84ec02f8e9fc0e814f (patch) | |
| tree | 9aade85e8006f32d0cbb50c8fcdaf3f6fde0e649 | |
| parent | b618fe1e97899d63f8c03766a2682defa39e5d28 (diff) | |
| download | decky-loader-76424174edfb330eecdf2d84ec02f8e9fc0e814f.tar.gz decky-loader-76424174edfb330eecdf2d84ec02f8e9fc0e814f.zip | |
Use call instead of Popen (#113)
| -rw-r--r-- | backend/main.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/backend/main.py b/backend/main.py index afd3cc21..99e6c618 100644 --- a/backend/main.py +++ b/backend/main.py @@ -17,7 +17,7 @@ basicConfig(level=CONFIG["log_level"], format="[%(module)s][%(levelname)s]: %(me from asyncio import get_event_loop, sleep from json import dumps, loads from os import path -from subprocess import Popen +from subprocess import call import aiohttp_cors from aiohttp.web import Application, run_app, static @@ -31,8 +31,10 @@ from utilities import Utilities logger = getLogger("Main") async def chown_plugin_dir(_): - Popen(["chown", "-R", "deck:deck", CONFIG["plugin_path"]]) - Popen(["chmod", "-R", "555", CONFIG["plugin_path"]]) + code_chown = call(["chown", "-R", "deck:deck", CONFIG["plugin_path"]]) + code_chmod = call(["chmod", "-R", "555", CONFIG["plugin_path"]]) + if code_chown != 0 or code_chmod != 0: + logger.error(f"chown/chmod exited with a non-zero exit code (chown: {code_chown}, chmod: {code_chmod})") class PluginManager: def __init__(self) -> None: |
