mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
Merge 0e570d7dcd into 11c1718983
This commit is contained in:
commit
81d4f81e3a
2 changed files with 46 additions and 0 deletions
26
plugins/fnox/README.md
Normal file
26
plugins/fnox/README.md
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
# fnox
|
||||||
|
|
||||||
|
Adds integration and shell completions for [fnox](https://github.com/jdx/fnox), a tool for provider-agnostic secret injection.
|
||||||
|
Supports either standalone activation or `mise` integration if installed.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
1. *Optional:* [Download & install mise](https://github.com/jdx/mise#installation) by running the following:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl https://mise.jdx.dev/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
2. [Enable fnox](https://fnox.jdx.dev/guide/quick-start.html) by adding it to your `plugins` definition in `~/.zshrc`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# standalone
|
||||||
|
plugins=(fnox)
|
||||||
|
|
||||||
|
# with mise integration
|
||||||
|
plugins=(mise fnox)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
See the [fnox documentation](https://github.com/jdx/fnox#table-of-contents) for information on how to use `fnox` [standalone](https://fnox.jdx.dev/guide/shell-integration.html) or with [`mise` integration](https://fnox.jdx.dev/guide/mise-integration.html).
|
||||||
20
plugins/fnox/fnox.plugin.zsh
Normal file
20
plugins/fnox/fnox.plugin.zsh
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
if (( ! $+commands[fnox] )); then
|
||||||
|
# if we don't have fnox at all just bail out
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if (( ! $+commands[mise] )); then
|
||||||
|
# if we have fnox but not mise, source its activation directly
|
||||||
|
eval "$(fnox activate zsh)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# If the completion file doesn't exist yet, we need to autoload it and
|
||||||
|
# bind it to `mise`. 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
|
||||||
|
|
||||||
|
# Generate and load completions
|
||||||
|
fnox completion zsh >| "$ZSH_CACHE_DIR/completions/_fnox" &|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue