Ignore variables used by direnv
All variables matching DIRENV_* are excluded to not influence direnv behavior.
This commit is contained in:
parent
ac83f17b77
commit
f6fc817e84
@ -32,13 +32,16 @@ diffEnvs() {
|
|||||||
|
|
||||||
while IFS= read -r -d '' line; do
|
while IFS= read -r -d '' line; do
|
||||||
name=$(tr -d '\0' <<<"$line" | head -n1 | cut -f1 -d'=')
|
name=$(tr -d '\0' <<<"$line" | head -n1 | cut -f1 -d'=')
|
||||||
|
if ! [[ "$name" = DIRENV_* ]]; then
|
||||||
if ! getByName "$name" "$new" >/dev/null; then
|
if ! getByName "$name" "$new" >/dev/null; then
|
||||||
echo "export -n '${name}'"
|
echo "export -n '${name}'"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done <"$old"
|
done <"$old"
|
||||||
|
|
||||||
while IFS= read -rd $'\0' line; do
|
while IFS= read -rd $'\0' line; do
|
||||||
name=$(tr -d '\0' <<<"$line" | head -n1 | cut -f1 -d'=')
|
name=$(tr -d '\0' <<<"$line" | head -n1 | cut -f1 -d'=')
|
||||||
|
if ! [[ "$name" = DIRENV_* ]]; then
|
||||||
if getByName "$name" "$old" >/dev/null; then
|
if getByName "$name" "$old" >/dev/null; then
|
||||||
# found in old env, check if values match
|
# found in old env, check if values match
|
||||||
if ! grep -z "^${line}\$" "$old" >/dev/null; then
|
if ! grep -z "^${line}\$" "$old" >/dev/null; then
|
||||||
@ -49,6 +52,7 @@ diffEnvs() {
|
|||||||
# variable is new
|
# variable is new
|
||||||
echo "export ${line@Q}"
|
echo "export ${line@Q}"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
done <"$new"
|
done <"$new"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user