1
0
Fork 0

Zsh: Make variables in functions local

This commit is contained in:
tastytea 2022-03-19 04:38:23 +01:00
parent c00f5dce6e
commit c6f8269245
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
2 changed files with 3 additions and 3 deletions

View File

@ -10,6 +10,6 @@ fi
[[ "$(emacsclient -e t)" == 't' ]] || return 1
for name in "${@}"; do
value=$(eval print \"\$${name}\")
local value=$(eval print \"\$${name}\")
emacsclient -e "(setenv \"${name}\" \"${value}\")" >/dev/null
done

View File

@ -9,7 +9,7 @@ fi
local dir="${1}"
for file in "${dir}"/*; do
basename="${file##*/}"
newfile="${dir}/${basename:l}"
local basename="${file##*/}"
local newfile="${dir}/${basename:l}"
[[ "${file}" != "${newfile}" ]] && mv "${file}" "${newfile}" || :
done