Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scoop-alias): Fix alias initialization #4737

Merged
merged 2 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- **shim:** Use `-file` instead of `-command` in ps1 script shims ([#4721](https://github.com/ScoopInstaller/Scoop/issues/4721))
- **versions:** Fix wrong version number when only one version dir ([#4679](https://github.com/ScoopInstaller/Scoop/issues/4679))
- **versions:** Get current version from failed installation if possible ([#4720](https://github.com/ScoopInstaller/Scoop/issues/4720), [#4725](https://github.com/ScoopInstaller/Scoop/issues/4725))
- **scoop-alias:** Fix alias initialization ([#4737](https://github.com/ScoopInstaller/Scoop/issues/4737))
- **scoop-checkup:** Skip 'check_windows_defender' when have not admin privileges ([#4699](https://github.com/ScoopInstaller/Scoop/issues/4699))
- **scoop-cleanup:** Remove apps other than current version ([#4665](https://github.com/ScoopInstaller/Scoop/issues/4665))
- **scoop-update:** Skip updating non git buckets ([#4670](https://github.com/ScoopInstaller/Scoop/issues/4670), [#4672](https://github.com/ScoopInstaller/Scoop/issues/4672))
Expand Down
10 changes: 5 additions & 5 deletions libexec/scoop-alias.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ $script:config_alias = 'alias'

function init_alias_config {
$aliases = get_config $script:config_alias
if (!$aliases) {
$aliases = @{}
if ($aliases) {
$aliases
} else {
New-Object -TypeName PSObject
}

return $aliases
}

function add_alias($name, $command) {
Expand Down Expand Up @@ -102,7 +102,7 @@ function list_aliases {
if ($verbose) {
return $aliases | Select-Object Name, Command, Summary | Format-Table -AutoSize -Wrap
} else {
return $aliases | Select-Object Name, Command | Format-Table -AutoSize -hidetablehead -Wrap
return $aliases | Select-Object Name, Command | Format-Table -AutoSize -Wrap
}
}

Expand Down