mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-11-27 10:53:03 +01:00
feat(fnox): add plugin (#13593)
This commit is contained in:
1 parent
0876f10264
commit
f5a74e0347
2 files changed
+38
No files matched your search
@@ -0,0 +1,15 @@
|
||||
# fnox
|
||||
|
||||
Adds shell integration and completions for [fnox](https://github.com/jdx/fnox), a tool for provider-agnostic secret injection.
|
||||
|
||||
## Installation
|
||||
|
||||
[Install fnox](https://fnox.jdx.dev/guide/quick-start.html), then add it to your plugins in `~/.zshrc`:
|
||||
|
||||
```zsh
|
||||
plugins=(fnox)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
See the [fnox documentation](https://fnox.jdx.dev/guide/shell-integration.html) for shell integration and usage.
|
||||
@@ -0,0 +1,23 @@
|
||||
if (( ! $+commands[fnox] )); then
|
||||
# if we don't have fnox at all just bail out
|
||||
return
|
||||
fi
|
||||
|
||||
eval "$(fnox activate zsh)"
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `fnox`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_fnox" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _fnox
|
||||
_comps[fnox]=_fnox
|
||||
fi
|
||||
|
||||
# Regenerate completions when the executable changes.
|
||||
if [[ ! -s "$ZSH_CACHE_DIR/completions/_fnox" || "$commands[fnox]" -nt "$ZSH_CACHE_DIR/completions/_fnox" ]]; then
|
||||
zmodload -F zsh/files b:zf_mv
|
||||
() {
|
||||
local TMPPREFIX="$ZSH_CACHE_DIR/completions/._fnox"
|
||||
zf_mv -f -- =( fnox completion zsh ) "$ZSH_CACHE_DIR/completions/_fnox"
|
||||
} &|
|
||||
fi
|
||||
Reference in new issue
Block a user