]> Sergey Matveev's repositories - zsh-autoenv.git/commitdiff
Use 'local' in functions
authorDaniel Hahler <git@thequod.de>
Sat, 15 Nov 2014 13:49:48 +0000 (14:49 +0100)
committerDaniel Hahler <git@thequod.de>
Sat, 15 Nov 2014 13:49:48 +0000 (14:49 +0100)
autoenv.zsh

index bb001aade4cd4b0abc7b6147ab742441b06954c0..51ccca0eec3d1fae2a5393d0f9de9e97cb38d166 100644 (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
 }