mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-07-11 18:51:59 +00:00
Improvements to install of remote binaries, and start backend reloading
This commit is contained in:
@@ -60,6 +60,9 @@ class PluginBrowser:
|
|||||||
if "remote_binary" in packageJson and len(packageJson["remote_binary"]) > 0:
|
if "remote_binary" in packageJson and len(packageJson["remote_binary"]) > 0:
|
||||||
# create bin directory if needed.
|
# create bin directory if needed.
|
||||||
rc=call(["chmod", "-R", "777", pluginBasePath])
|
rc=call(["chmod", "-R", "777", pluginBasePath])
|
||||||
|
if rc != 0:
|
||||||
|
logger.error(f"chown of plugin w/ remote binary exited with a non-zero exit code, chmod: {rc})")
|
||||||
|
|
||||||
if access(pluginBasePath, W_OK):
|
if access(pluginBasePath, W_OK):
|
||||||
|
|
||||||
if not path.exists(pluginBinPath):
|
if not path.exists(pluginBinPath):
|
||||||
@@ -67,6 +70,8 @@ class PluginBrowser:
|
|||||||
|
|
||||||
if not access(pluginBinPath, W_OK):
|
if not access(pluginBinPath, W_OK):
|
||||||
rc=call(["chmod", "-R", "777", pluginBinPath])
|
rc=call(["chmod", "-R", "777", pluginBinPath])
|
||||||
|
if rc != 0:
|
||||||
|
logger.error(f"chown of plugin w/ remote binary exited with a non-zero exit code, chmod: {rc})")
|
||||||
|
|
||||||
rv = True
|
rv = True
|
||||||
for remoteBinary in packageJson["remote_binary"]:
|
for remoteBinary in packageJson["remote_binary"]:
|
||||||
@@ -80,6 +85,8 @@ class PluginBrowser:
|
|||||||
|
|
||||||
code_chown = call(["chown", "-R", get_user()+":"+get_user_group(), self.plugin_path])
|
code_chown = call(["chown", "-R", get_user()+":"+get_user_group(), self.plugin_path])
|
||||||
rc=call(["chmod", "-R", "555", pluginBasePath])
|
rc=call(["chmod", "-R", "555", pluginBasePath])
|
||||||
|
if code_chown or rc != 0:
|
||||||
|
logger.error(f"chown/chmod exited with a non-zero exit code (chown: {code_chown}, chmod: {rc})")
|
||||||
else:
|
else:
|
||||||
rv = True
|
rv = True
|
||||||
logger.debug(f"No Remote Binaries to Download")
|
logger.debug(f"No Remote Binaries to Download")
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class PluginManager:
|
|||||||
chown_plugin_dir()
|
chown_plugin_dir()
|
||||||
self.loop.create_task(self.loader_reinjector())
|
self.loop.create_task(self.loader_reinjector())
|
||||||
self.loop.create_task(self.load_plugins())
|
self.loop.create_task(self.load_plugins())
|
||||||
|
self.loop.create_task(self.reload_plugin_backends())
|
||||||
|
|
||||||
self.web_app.on_startup.append(startup)
|
self.web_app.on_startup.append(startup)
|
||||||
|
|
||||||
@@ -116,6 +117,13 @@ class PluginManager:
|
|||||||
self.plugin_loader.import_plugins()
|
self.plugin_loader.import_plugins()
|
||||||
# await inject_to_tab("SP", "window.syncDeckyPlugins();")
|
# await inject_to_tab("SP", "window.syncDeckyPlugins();")
|
||||||
|
|
||||||
|
async def reload_plugin_backend(self, name):
|
||||||
|
await self.wait_for_server()
|
||||||
|
if name in self.loader.plugins:
|
||||||
|
self.loader.plugins[name].stop()
|
||||||
|
self.loader.plugins.pop(name, None)
|
||||||
|
|
||||||
|
|
||||||
async def loader_reinjector(self):
|
async def loader_reinjector(self):
|
||||||
while True:
|
while True:
|
||||||
tab = None
|
tab = None
|
||||||
|
|||||||
Reference in New Issue
Block a user