Skip to content

Commit 8962748

Browse files
committed
fix: no $ support for .key parameters
1 parent a37a62a commit 8962748

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

screenpack-updater.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,10 +1008,18 @@ def _unwrap_wrapping_quotes(value_body: str):
10081008
return False, s
10091009

10101010
def _normalize_key_value_if_needed(orig_key: str, value: str) -> str:
1011-
"""If key name ends with '.key' (case-insensitive), turn 'a&b&c' into 'a, b, c'."""
1011+
"""
1012+
If key name ends with '.key' (case-insensitive):
1013+
- strip '$' from key tokens (e.g. '$U' -> 'U')
1014+
- normalize list separator: 'a&b&c' -> 'a, b, c'
1015+
"""
10121016
if re.search(r'\.key$', orig_key, flags=re.IGNORECASE):
1013-
parts = [p.strip() for p in value.split('&') if p.strip() != '']
1014-
new_value = ', '.join(parts) if parts else value.strip()
1017+
cleaned = (value or "").replace('$', '')
1018+
# Preserve existing comma-separated values; only normalize '&' lists.
1019+
parts = [p.strip() for p in cleaned.split('&')]
1020+
# Drop empty tokens after cleanup
1021+
parts = [p for p in parts if p != '']
1022+
new_value = ', '.join(parts) if parts else cleaned.strip()
10151023
return new_value
10161024
return value
10171025

0 commit comments

Comments
 (0)