@@ -1205,26 +1205,28 @@ $configFile = "$configHome\scoop\config.json"
1205
1205
$scoopConfig = load_cfg $configFile
1206
1206
1207
1207
# NOTE Scoop config file migration. Remove this after 2023/6/30
1208
- $newConfigNames = @ {
1209
- ' lastupdate' = ' last_update'
1210
- ' SCOOP_REPO' = ' scoop_repo'
1211
- ' SCOOP_BRANCH' = ' scoop_branch'
1212
- ' 7ZIPEXTRACT_USE_EXTERNAL' = ' use_external_7zip'
1213
- ' MSIEXTRACT_USE_LESSMSI' = ' use_lessmsi'
1214
- ' NO_JUNCTIONS' = ' no_junction'
1215
- ' manifest_review' = ' show_manifest'
1216
- ' rootPath' = ' root_path'
1217
- ' globalPath' = ' global_path'
1218
- ' cachePath' = ' cache_path'
1219
- }
1220
- $newConfigNames.GetEnumerator () | ForEach-Object {
1221
- if ($null -ne $scoopConfig .$ ($_.Key )) {
1222
- $value = $scoopConfig .$ ($_.Key )
1223
- $scoopConfig.PSObject.Properties.Remove ($_.Key )
1224
- $scoopConfig | Add-Member - MemberType NoteProperty - Name $_.Value - Value $value
1225
- }
1226
- }
1227
- ConvertTo-Json $scoopConfig | Out-UTF8File - FilePath $configFile
1208
+ if ($scoopConfig ) {
1209
+ $newConfigNames = @ {
1210
+ ' lastupdate' = ' last_update'
1211
+ ' SCOOP_REPO' = ' scoop_repo'
1212
+ ' SCOOP_BRANCH' = ' scoop_branch'
1213
+ ' 7ZIPEXTRACT_USE_EXTERNAL' = ' use_external_7zip'
1214
+ ' MSIEXTRACT_USE_LESSMSI' = ' use_lessmsi'
1215
+ ' NO_JUNCTIONS' = ' no_junction'
1216
+ ' manifest_review' = ' show_manifest'
1217
+ ' rootPath' = ' root_path'
1218
+ ' globalPath' = ' global_path'
1219
+ ' cachePath' = ' cache_path'
1220
+ }
1221
+ $newConfigNames.GetEnumerator () | ForEach-Object {
1222
+ if ($null -ne $scoopConfig .$ ($_.Key )) {
1223
+ $value = $scoopConfig .$ ($_.Key )
1224
+ $scoopConfig.PSObject.Properties.Remove ($_.Key )
1225
+ $scoopConfig | Add-Member - MemberType NoteProperty - Name $_.Value - Value $value
1226
+ }
1227
+ }
1228
+ ConvertTo-Json $scoopConfig | Out-UTF8File - FilePath $configFile
1229
+ }
1228
1230
# END NOTE
1229
1231
1230
1232
# Scoop root directory
0 commit comments