mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-27 05:26:06 +02:00
Compare commits
1
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:
|
The cache is stored at:
|
||||||
|
|
||||||
- `$ZSH_CACHE_DIR/completions/_gh` completions script
|
- `$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
|
zmodload -F zsh/files b:zf_mv
|
||||||
() {
|
() {
|
||||||
local TMPPREFIX="$ZSH_CACHE_DIR/completions/_gh"
|
local completion_file="$ZSH_CACHE_DIR/completions/_gh"
|
||||||
zf_mv -f -- =( gh completion --shell zsh ) "$TMPPREFIX"
|
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