summaryrefslogtreecommitdiff
path: root/defaults
diff options
context:
space:
mode:
authorwuriko <noahfenghom@gmail.com>2026-02-10 20:07:53 +0100
committerwuriko <noahfenghom@gmail.com>2026-02-10 20:07:53 +0100
commit173a50320c5085b1b55cf43380f4cd5650a71b67 (patch)
tree335820045e8d54946a1a1a0e4e3d312aa06da530 /defaults
parentc17dba2d1ceebf2fae54e5ded0f3481ee2e834cd (diff)
downloadDecky-Framegen-173a50320c5085b1b55cf43380f4cd5650a71b67.tar.gz
Decky-Framegen-173a50320c5085b1b55cf43380f4cd5650a71b67.zip
refactor: remove unnecessary add key step
Diffstat (limited to 'defaults')
-rw-r--r--defaults/assets/update-optiscaler-config.py11
1 files changed, 0 insertions, 11 deletions
diff --git a/defaults/assets/update-optiscaler-config.py b/defaults/assets/update-optiscaler-config.py
index 9c00ee1..1fce84a 100644
--- a/defaults/assets/update-optiscaler-config.py
+++ b/defaults/assets/update-optiscaler-config.py
@@ -23,7 +23,6 @@ def update_optiscaler_config(file_path):
key_target = parts[2]
found_section = False
- updated_key = False
# Regex to match [Section] and Key=Value
section_pattern = re.compile(rf'^\s*\[{re.escape(section_target)}\]\s*')
@@ -42,19 +41,9 @@ def update_optiscaler_config(file_path):
# Replace the value if the key is found within the correct section
if found_section and key_pattern.match(line):
lines[i] = key_pattern.sub(r'\1=' + env_value, line)
- updated_key = True
print(f"Updated: [{section_target}] {key_target} = {env_value}")
break
- # If section exists but key doesn't, append key to the end of the section
- # Not really needed but supported just in case
- if found_section and not updated_key:
- for i, line in enumerate(lines):
- if section_pattern.match(line):
- lines.insert(i + 1, f"{key_target}={env_value}\n")
- print(f"Added new key: [{section_target}] {key_target} = {env_value}")
- break
-
# Write the modified content back
with open(file_path, 'w') as f:
f.writelines(lines)