[Bug] The scoop_*
properties in $scoopConfig
are invariably removed and re-added
#5434
Labels
scoop_*
properties in $scoopConfig
are invariably removed and re-added
#5434
Bug Report
Current Behavior
When iterating through
$newConfigNames
inlib/core.ps1
, the method of accessing the value in$scoopConfig
by key is not case-sensitive. This results in thescoop_*
properties being removed and re-added, even if they are already using the new naming convention.Expected Behavior
I expect that
$scoopConfig
is left untouched if it already contains the new property names (snake_case instead of SCREAMING_CASE).Additional context/output
I am managing my Scoop config with chezmoi.
I parse the existing config into an unordered dictionary, edit some values if required, then output the new config to a JSON string. This output JSON invariably has its properties in alphabetical order. There is no trivial way to prevent this.
This would be fine, if, when Scoop updates, it doesn't change any config object properties unless it has to.
With my current config (seen below), if Scoop updates, it changes the config to:
This results in a lot of unnecessary
diff
s.Possible Solution
Perform a case-sensitive lookup, perhaps something like:
If I edit my current config (again, seen below) to use
SCOOP_BRANCH
instead, this case-sensitive lookup would result in the following config:This would require parsing and outputting again on my end to get it back into alphabetical order. Crucially, though, this would only need to happen once, as Scoop would then leave the config untouched thereafter.
My proposed change seems to work when debugging with
update --force
, but I'm as yet unsure of any major ramifications.System details
Windows version: 10
OS architecture: 64bit
PowerShell version: 5.1.19041.2364, 7.3.3
Additional software: N/A
Scoop Configuration
The text was updated successfully, but these errors were encountered: