mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-27 13:36:07 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b20d95c390 |
@@ -18,3 +18,5 @@ plugin is loaded, which is usually when you start up a new terminal emulator.
|
||||
The cache is stored at:
|
||||
|
||||
- `$ZSH_CACHE_DIR/completions/_gh` completions script
|
||||
|
||||
If an update fails, the last successfully generated completion script is kept.
|
||||
|
||||
@@ -13,6 +13,12 @@ fi
|
||||
|
||||
zmodload -F zsh/files b:zf_mv
|
||||
() {
|
||||
local TMPPREFIX="$ZSH_CACHE_DIR/completions/_gh"
|
||||
zf_mv -f -- =( gh completion --shell zsh ) "$TMPPREFIX"
|
||||
local completion_file="$ZSH_CACHE_DIR/completions/_gh"
|
||||
local completion_tmp="${completion_file}.$$.${RANDOM}"
|
||||
|
||||
if gh completion --shell zsh >| "$completion_tmp" && [[ -s "$completion_tmp" ]]; then
|
||||
zf_mv -f -- "$completion_tmp" "$completion_file"
|
||||
fi
|
||||
|
||||
command rm -f -- "$completion_tmp"
|
||||
} &|
|
||||
|
||||
Reference in New Issue
Block a user