mirror of
https://github.com/SteamDeckHomebrew/decky-loader.git
synced 2026-06-17 08:47:49 +00:00
Feat/configurable paths (#404)
This commit is contained in:
committed by
GitHub
parent
4777963b65
commit
d6f336d84b
+4
-5
@@ -1,6 +1,6 @@
|
||||
from json import dump, load
|
||||
from os import mkdir, path, listdir, rename
|
||||
from localplatform import chown, folder_owner
|
||||
from localplatform import chown, folder_owner, get_chown_plugin_path
|
||||
from customtypes import UserType
|
||||
|
||||
from helpers import get_homebrew_path
|
||||
@@ -17,7 +17,6 @@ class SettingsManager:
|
||||
#Create the folder with the correct permission
|
||||
if not path.exists(settings_directory):
|
||||
mkdir(settings_directory)
|
||||
chown(settings_directory)
|
||||
|
||||
#Copy all old settings file in the root directory to the correct folder
|
||||
for file in listdir(wrong_dir):
|
||||
@@ -28,9 +27,9 @@ class SettingsManager:
|
||||
|
||||
|
||||
#If the owner of the settings directory is not the user, then set it as the user:
|
||||
|
||||
if folder_owner(settings_directory) != UserType.HOST_USER:
|
||||
chown(settings_directory, UserType.HOST_USER, False)
|
||||
expected_user = UserType.HOST_USER if get_chown_plugin_path() else UserType.ROOT
|
||||
if folder_owner(settings_directory) != expected_user:
|
||||
chown(settings_directory, expected_user, False)
|
||||
|
||||
self.settings = {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user