1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2026-01-08 21:28:24 +08:00

Compare commits

..

No commits in common. "52f9238b16ddc8a97690b49c8b395e9fe1169b62" and "a6df94d2c677c6d28c5ee339975b7a56a2f67e21" have entirely different histories.

4 changed files with 8 additions and 20 deletions

View File

@ -32,8 +32,6 @@ PORT=3001
```
You can even mix both formats, although it's probably a bad idea.
## Plugin options
### ZSH_DOTENV_FILE
You can also modify the name of the file to be loaded with the variable `ZSH_DOTENV_FILE`.
@ -45,10 +43,6 @@ For example, this will make the plugin look for files named `.dotenv` and load t
ZSH_DOTENV_FILE=.dotenv
```
### ZSH_DOTENV_PROMPT
Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message.
## Version Control
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only.

View File

@ -1,15 +1,10 @@
source_env() {
if [[ -f $ZSH_DOTENV_FILE ]]; then
if [ "$ZSH_DOTENV_PROMPT" != "false" ]; then
# confirm before sourcing file
local confirmation
# print same-line prompt and output newline character if necessary
echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo
# only bail out if confirmation character is n
if [[ "$confirmation" = [nN] ]]; then
return
fi
# confirm before sourcing .env file
local confirmation
echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
return
fi
# test .env syntax

View File

@ -10,7 +10,6 @@ function setup_using_base_dir() {
if [[ -z "${fzf_base}" ]]; then
fzfdirs=(
"${HOME}/.fzf"
"${HOME}/.nix-profile/share/fzf"
"/usr/local/opt/fzf"
"/usr/share/fzf"
"/usr/local/share/examples/fzf"
@ -32,8 +31,8 @@ function setup_using_base_dir() {
fi
if [[ -d "${fzf_base}" ]]; then
# Fix fzf shell directory for Arch Linux, NixOS or Void Linux packages
if [[ ! -d "${fzf_base}/shell" ]]; then
# Fix fzf shell directory for Archlinux package
if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
fzf_shell="${fzf_base}"
else
fzf_shell="${fzf_base}/shell"

View File

@ -14,7 +14,7 @@ fi
alias k=kubectl
# Execute a kubectl command against all namespaces
alias kca='_kca(){ kubectl "$@" --all-namespaces; unset -f _kca; }; _kca'
alias kca='f(){ kubectl "$@" --all-namespaces; unset -f f; }; f'
# Apply a YML file
alias kaf='kubectl apply -f'