Skip to content

Commit

Permalink
feat(scoop-config): Show all settings (ScoopInstaller#4765)
Browse files Browse the repository at this point in the history
* feat(scoop-config): Show all settings

* cl
  • Loading branch information
rashil2000 authored Feb 28, 2022
1 parent 9024ee4 commit a8e36d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

### Features

- **config:** Allow Scoop to ignore running processes during reset/uninstall/update ([#4713](https://github.com/ScoopInstaller/Scoop/issues/4713), [#4731](https://github.com/ScoopInstaller/Scoop/issues/4731))
- **scoop-config:** Allow Scoop to ignore running processes during reset/uninstall/update ([#4713](https://github.com/ScoopInstaller/Scoop/issues/4713), [#4731](https://github.com/ScoopInstaller/Scoop/issues/4731))
- **scoop-config:** Show all settings ([#4765](https://github.com/ScoopInstaller/Scoop/issues/4765))
- **scoop-alter:** Add `scoop alter` command to switch shim's target ([#4727](https://github.com/ScoopInstaller/Scoop/issues/4727))
- **scoop-bucket:** List more detailed information for buckets ([#4704](https://github.com/ScoopInstaller/Scoop/issues/4704))
- **scoop-cache:** Handle multiple apps and show detailed information ([#4738](https://github.com/ScoopInstaller/Scoop/issues/4738))
Expand Down
26 changes: 16 additions & 10 deletions libexec/scoop-config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# Summary: Get or set configuration values
# Help: The scoop configuration file is saved at ~/.config/scoop/config.json.
#
# To get all configuration settings:
#
# scoop config
#
# To get a configuration setting:
#
# scoop config <name>
Expand Down Expand Up @@ -123,25 +127,27 @@

param($name, $value)

. "$psscriptroot\..\lib\core.ps1"
. "$psscriptroot\..\lib\help.ps1"
. "$PSScriptRoot\..\lib\core.ps1"
. "$PSScriptRoot\..\lib\help.ps1"

reset_aliases

if(!$name) { my_usage; exit 1 }

if($name -like 'rm') {
if (!$name) {
$scoopConfig
} elseif ($name -like '--help') {
my_usage
} elseif ($name -like 'rm') {
set_config $value $null | Out-Null
Write-Output "'$value' has been removed"
} elseif($null -ne $value) {
Write-Host "'$value' has been removed"
} elseif ($null -ne $value) {
set_config $name $value | Out-Null
Write-Output "'$name' has been set to '$value'"
Write-Host "'$name' has been set to '$value'"
} else {
$value = get_config $name
if($null -eq $value) {
Write-Output "'$name' is not set"
Write-Host "'$name' is not set"
} else {
Write-Output $value
$value
}
}

Expand Down

0 comments on commit a8e36d3

Please sign in to comment.