ohmyzsh/plugins/gitignore/gitignore.plugin.zsh
HOHOH134 e076690551
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1s
feat(gitignore): use cdn as endpoint (#13497)
2026-01-20 10:21:56 +01:00

21 lines
No EOL
395 B
Bash

# gitignore plugin for oh-my-zsh
# Uses gitignore.io CDN endpoint
function _gi_curl() {
curl -sfL "https://www.gitignore.io/api/$1"
}
function gi() {
local query="${(j:,:)@}"
_gi_curl "$query" || return 1
}
_gitignoreio_get_command_list() {
_gi_curl "list" | tr "," "\n"
}
_gitignoreio () {
compset -P '*,'
compadd -S '' $(_gitignoreio_get_command_list)
}
compdef _gitignoreio gi