mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 00:39:48 +08:00
c2155b770d
`gh` doesn't write its errors to stderr and doesn't exit with a non-zero status code in case of failure. The completions are short enough that buffering them isn't a huge deal.
7 lines
377 B
Fish
7 lines
377 B
Fish
# gh, at least as of version 1.17.5, does not write errors to stderr, causing
|
|
# `checks/completions.fish` to fail if the `gh-completion` module is missing.
|
|
# It also does not exit with a non-zero error code, making this harder than it needs to be :(
|
|
set completion "$(gh completion --shell fish)"
|
|
string match -rq '^Error' -- $completion && return -1
|
|
echo $completion | source
|