mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
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:
parent
1b5584a71d
commit
7b2ec35cf2
1 changed files with 16 additions and 2 deletions
|
@ -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 [] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue