Skip to content

Commit

Permalink
refactor(core): Cleanup some old codes, e.g., msi section and confi…
Browse files Browse the repository at this point in the history
…g migration (#5715)
  • Loading branch information
niheaven authored Mar 6, 2024
1 parent 48f7935 commit 7e3dc73
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 304 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

- **git:** Use Invoke-Git() with direct path to git.exe to prevent spawning shim subprocesses ([#5122](https://github.com/ScoopInstaller/Scoop/issues/5122), [#5375](https://github.com/ScoopInstaller/Scoop/issues/5375))
- **scoop-download:** Output more detailed manifest information ([#5277](https://github.com/ScoopInstaller/Scoop/issues/5277))
- **core:** Cleanup some old codes, e.g., msi section and config migration ([#5715](https://github.com/ScoopInstaller/Scoop/issues/5715))

### Builds

Expand Down
25 changes: 0 additions & 25 deletions lib/core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1415,31 +1415,6 @@ if ($pathExpected) {
}
$scoopConfig = load_cfg $configFile

# NOTE Scoop config file migration. Remove this after 2023/6/30
if ($scoopConfig -and $scoopConfig.PSObject.Properties.Name -contains 'lastUpdate') {
$newConfigNames = @{
'lastUpdate' = 'last_update'
'SCOOP_REPO' = 'scoop_repo'
'SCOOP_BRANCH' = 'scoop_branch'
'7ZIPEXTRACT_USE_EXTERNAL' = 'use_external_7zip'
'MSIEXTRACT_USE_LESSMSI' = 'use_lessmsi'
'NO_JUNCTIONS' = 'no_junction'
'manifest_review' = 'show_manifest'
'rootPath' = 'root_path'
'globalPath' = 'global_path'
'cachePath' = 'cache_path'
}
$newConfigNames.GetEnumerator() | ForEach-Object {
if ($null -ne $scoopConfig.$($_.Key)) {
$value = $scoopConfig.$($_.Key)
$scoopConfig.PSObject.Properties.Remove($_.Key)
$scoopConfig | Add-Member -MemberType NoteProperty -Name $_.Value -Value $value
}
}
ConvertTo-Json $scoopConfig | Out-UTF8File -FilePath $configFile
}
# END NOTE

# Scoop root directory
$scoopdir = $env:SCOOP, (get_config ROOT_PATH), (Resolve-Path "$PSScriptRoot\..\..\..\.."), "$([System.Environment]::GetFolderPath('UserProfile'))\scoop" | Where-Object { -not [String]::IsNullOrEmpty($_) } | Select-Object -First 1

Expand Down
Loading

0 comments on commit 7e3dc73

Please sign in to comment.