mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-26 01:57:26 +08:00
Compare commits
No commits in common. "52f9238b16ddc8a97690b49c8b395e9fe1169b62" and "a6df94d2c677c6d28c5ee339975b7a56a2f67e21" have entirely different histories.
52f9238b16
...
a6df94d2c6
@ -32,8 +32,6 @@ PORT=3001
|
|||||||
```
|
```
|
||||||
You can even mix both formats, although it's probably a bad idea.
|
You can even mix both formats, although it's probably a bad idea.
|
||||||
|
|
||||||
## Plugin options
|
|
||||||
|
|
||||||
### ZSH_DOTENV_FILE
|
### ZSH_DOTENV_FILE
|
||||||
|
|
||||||
You can also modify the name of the file to be loaded with the variable `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_FILE=.dotenv
|
||||||
```
|
```
|
||||||
|
|
||||||
### ZSH_DOTENV_PROMPT
|
|
||||||
|
|
||||||
Set `ZSH_DOTENV_PROMPT=false` in your zshrc file if you don't want the confirmation message.
|
|
||||||
|
|
||||||
## Version Control
|
## 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.
|
**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.
|
||||||
|
|||||||
@ -1,15 +1,10 @@
|
|||||||
source_env() {
|
source_env() {
|
||||||
if [[ -f $ZSH_DOTENV_FILE ]]; then
|
if [[ -f $ZSH_DOTENV_FILE ]]; then
|
||||||
if [ "$ZSH_DOTENV_PROMPT" != "false" ]; then
|
# confirm before sourcing .env file
|
||||||
# confirm before sourcing file
|
local confirmation
|
||||||
local confirmation
|
echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
|
||||||
# print same-line prompt and output newline character if necessary
|
if read -k 1 confirmation && [[ $confirmation = [nN] ]]; then
|
||||||
echo -n "dotenv: source '$ZSH_DOTENV_FILE' file in the directory? (Y/n) "
|
return
|
||||||
read -k 1 confirmation; [[ "$confirmation" != $'\n' ]] && echo
|
|
||||||
# only bail out if confirmation character is n
|
|
||||||
if [[ "$confirmation" = [nN] ]]; then
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# test .env syntax
|
# test .env syntax
|
||||||
|
|||||||
@ -10,7 +10,6 @@ function setup_using_base_dir() {
|
|||||||
if [[ -z "${fzf_base}" ]]; then
|
if [[ -z "${fzf_base}" ]]; then
|
||||||
fzfdirs=(
|
fzfdirs=(
|
||||||
"${HOME}/.fzf"
|
"${HOME}/.fzf"
|
||||||
"${HOME}/.nix-profile/share/fzf"
|
|
||||||
"/usr/local/opt/fzf"
|
"/usr/local/opt/fzf"
|
||||||
"/usr/share/fzf"
|
"/usr/share/fzf"
|
||||||
"/usr/local/share/examples/fzf"
|
"/usr/local/share/examples/fzf"
|
||||||
@ -32,8 +31,8 @@ function setup_using_base_dir() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -d "${fzf_base}" ]]; then
|
if [[ -d "${fzf_base}" ]]; then
|
||||||
# Fix fzf shell directory for Arch Linux, NixOS or Void Linux packages
|
# Fix fzf shell directory for Archlinux package
|
||||||
if [[ ! -d "${fzf_base}/shell" ]]; then
|
if [[ ! -d "${fzf_base}/shell" ]] && [[ -f /etc/arch-release ]]; then
|
||||||
fzf_shell="${fzf_base}"
|
fzf_shell="${fzf_base}"
|
||||||
else
|
else
|
||||||
fzf_shell="${fzf_base}/shell"
|
fzf_shell="${fzf_base}/shell"
|
||||||
|
|||||||
@ -14,7 +14,7 @@ fi
|
|||||||
alias k=kubectl
|
alias k=kubectl
|
||||||
|
|
||||||
# Execute a kubectl command against all namespaces
|
# 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
|
# Apply a YML file
|
||||||
alias kaf='kubectl apply -f'
|
alias kaf='kubectl apply -f'
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user