Update scoop completions (#930)

made scoop completions a bit more reliable by converting the PsObject
from powershell to json instead of parsing lines from the `scoop help`
output

doesn't take any longer since scoop run in powershell either way

Co-authored-by: unknown <67888720+kira-nyx@users.noreply.github.com>
This commit is contained in:
Kira 2024-08-14 08:16:37 -03:00 committed by GitHub
parent 1b5584a71d
commit 7b2ec35cf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,11 +92,25 @@ def scoopShimBuilds [] {
}
def scoopCommands [] {
scoop help | lines --skip-empty | skip 5 | parse '{value} {description}' | str trim
^powershell -nop -nol -c "(scoop help | ConvertTo-Json -Compress)"
| decode
| lines
| last
| to text
| from json
| rename value description
}
def scoopAliases [] {
scoop alias list | lines --skip-empty | skip 2 | parse '{name} {path}' | get name
^powershell -nop -nol -c "(scoop alias list|ConvertTo-Json -Compress)"
| decode
| str trim
| lines
| last
| to text
| '[' + $in + ']'
| from json
| get Name
}
def batStyles [] {