Skip to content

Commit b616db7

Browse files
authored
fix: Use snake_case config names (ScoopInstaller#33)
1 parent d389cb1 commit b616db7

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

install.ps1

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -437,44 +437,44 @@ function Add-Config {
437437
}
438438

439439
function Add-DefaultConfig {
440-
# If user-level SCOOP env not defined, save to rootPath
440+
# If user-level SCOOP env not defined, save to root_path
441441
if (!(Get-Env 'SCOOP')) {
442442
if ($SCOOP_DIR -ne "$env:USERPROFILE\scoop") {
443-
Write-Verbose "Adding config rootPath: $SCOOP_DIR"
444-
Add-Config -Name 'rootPath' -Value $SCOOP_DIR | Out-Null
443+
Write-Verbose "Adding config root_path: $SCOOP_DIR"
444+
Add-Config -Name 'root_path' -Value $SCOOP_DIR | Out-Null
445445
}
446446
}
447447

448448
# Use system SCOOP_GLOBAL, or set system SCOOP_GLOBAL
449-
# with $env:SCOOP_GLOBAL if RunAsAdmin, otherwise save to globalPath
449+
# with $env:SCOOP_GLOBAL if RunAsAdmin, otherwise save to global_path
450450
if (!(Get-Env 'SCOOP_GLOBAL' -global)) {
451451
if ((Test-IsAdministrator) -and $env:SCOOP_GLOBAL) {
452452
Write-Verbose "Setting System Environment Variable SCOOP_GLOBAL: $env:SCOOP_GLOBAL"
453453
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
454454
} else {
455455
if ($SCOOP_GLOBAL_DIR -ne "$env:ProgramData\scoop") {
456-
Write-Verbose "Adding config globalPath: $SCOOP_GLOBAL_DIR"
457-
Add-Config -Name 'globalPath' -Value $SCOOP_GLOBAL_DIR | Out-Null
456+
Write-Verbose "Adding config global_path: $SCOOP_GLOBAL_DIR"
457+
Add-Config -Name 'global_path' -Value $SCOOP_GLOBAL_DIR | Out-Null
458458
}
459459
}
460460
}
461461

462462
# Use system SCOOP_CACHE, or set system SCOOP_CACHE
463-
# with $env:SCOOP_CACHE if RunAsAdmin, otherwise save to cachePath
463+
# with $env:SCOOP_CACHE if RunAsAdmin, otherwise save to cache_path
464464
if (!(Get-Env 'SCOOP_CACHE' -global)) {
465465
if ((Test-IsAdministrator) -and $env:SCOOP_CACHE) {
466466
Write-Verbose "Setting System Environment Variable SCOOP_CACHE: $env:SCOOP_CACHE"
467467
[Environment]::SetEnvironmentVariable('SCOOP_CACHE', $env:SCOOP_CACHE, 'Machine')
468468
} else {
469469
if ($SCOOP_CACHE_DIR -ne "$SCOOP_DIR\cache") {
470-
Write-Verbose "Adding config cachePath: $SCOOP_CACHE_DIR"
471-
Add-Config -Name 'cachePath' -Value $SCOOP_CACHE_DIR | Out-Null
470+
Write-Verbose "Adding config cache_path: $SCOOP_CACHE_DIR"
471+
Add-Config -Name 'cache_path' -Value $SCOOP_CACHE_DIR | Out-Null
472472
}
473473
}
474474
}
475475

476-
# save current datatime to lastUpdate
477-
Add-Config -Name 'lastUpdate' -Value ([System.DateTime]::Now.ToString('o')) | Out-Null
476+
# save current datatime to last_update
477+
Add-Config -Name 'last_update' -Value ([System.DateTime]::Now.ToString('o')) | Out-Null
478478
}
479479

480480
function Install-Scoop {

0 commit comments

Comments
 (0)