Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ea51061

Browse files
committedFeb 24, 2025·
fix some scoop completion bugs
1 parent 8cfd7ce commit ea51061

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎custom-completions/scoop/scoop-completions.nu

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ def scoopAllApps [] {
4040
} else {
4141
[ $env.USERPROFILE, 'scoop', 'buckets' ] | path join
4242
}
43-
(ls -s $bucketsDir | get name) | each {|bucket| ls ([$bucketsDir, $bucket, 'bucket', '*.json'] | path join ) | get name | path basename | str substring ..-5} | flatten | uniq
43+
(ls -s $bucketsDir | get name) | each {|bucket| ls ([$bucketsDir, $bucket, 'bucket'] | path join ) | get name | path parse | where extension == json | get stem } | flatten | uniq
4444
}
4545

4646
# list of all apps that are not installed
4747
def scoopAvailableApps [] {
4848
let all = (scoopAllApps)
4949
let installed = (scoopInstalledApps)
5050

51-
$all | where not $it in $installed
51+
$all | where not ($it in $installed)
5252
}
5353

5454
# list of all config options
@@ -117,7 +117,7 @@ def scoopCommands [] {
117117
[value, description];
118118
[
119119
# eg. scoop-help.ps1 -> help
120-
($command.name | path basename | str substring 6..-5),
120+
($command.name | path parse | get stem |str substring 6..),
121121
# second line is starts with '# Summary: '
122122
# eg. '# Summary: Install apps' -> 'Install apps'
123123
(open $command.name | lines | skip 1 | first | str substring 11..)

0 commit comments

Comments
 (0)
Please sign in to comment.