1
0
mirror of https://github.com/Tarrasch/zsh-autoenv.git synced 2024-11-22 07:20:59 +02:00

Use 'local' in functions

This commit is contained in:
Daniel Hahler 2014-11-15 14:49:48 +01:00
parent 1e60c98e4a
commit 41625bf31c

View File

@ -4,26 +4,26 @@
export ENV_AUTHORIZATION_FILE=$HOME/.env_auth
_dotenv_hash_pair() {
env_file=$1
local env_file=$1
env_shasum=$(shasum $env_file | cut -d' ' -f1)
echo "$env_file:$env_shasum"
}
_dotenv_authorized_env_file() {
env_file=$1
pair=$(_dotenv_hash_pair $env_file)
local env_file=$1
local pair=$(_dotenv_hash_pair $env_file)
touch $ENV_AUTHORIZATION_FILE
\grep -Gq $pair $ENV_AUTHORIZATION_FILE
}
_dotenv_authorize() {
env_file=$1
local env_file=$1
_dotenv_deauthorize $env_file
_dotenv_hash_pair $env_file >> $ENV_AUTHORIZATION_FILE
}
_dotenv_deauthorize() {
env_file=$1
local env_file=$1
echo $(\grep -Gv $env_file $ENV_AUTHORIZATION_FILE) > $ENV_AUTHORIZATION_FILE
}