feat: added sorting to gitignore command query strings

This commit is contained in:
Ceferino Patino 2025-09-20 22:46:07 -05:00
commit f785e4762e
No known key found for this signature in database

View file

@ -38,11 +38,12 @@ def "nu-complete gi" [] {
}
def gi [...args: string@"nu-complete gi"] {
if ($args | length) > 0 and $args.0 == "list" {
do { _gitignoreio_list }
if ($args | where {|x| $x == "list"} | length) > 0 {
return (_gitignoreio_list)
}
let joined = ($args | str join ",")
# Join templates with commas and fetch .gitignore
let joined = ($args | sort | str join ",")
http get $"https://www.toptal.com/developers/gitignore/api/($joined)"
}