From 7b2ec35cf276edc294c07d13301a2cb3f032bc91 Mon Sep 17 00:00:00 2001 From: Kira <67888720+koffydrop@users.noreply.github.com> Date: Wed, 14 Aug 2024 08:16:37 -0300 Subject: [PATCH] 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> --- custom-completions/scoop/scoop-completions.nu | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/custom-completions/scoop/scoop-completions.nu b/custom-completions/scoop/scoop-completions.nu index c1bc0ab..cc4ba94 100644 --- a/custom-completions/scoop/scoop-completions.nu +++ b/custom-completions/scoop/scoop-completions.nu @@ -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 [] {