Compare commits
1 Commits
a498992c2a
...
ac83f17b77
Author | SHA1 | Date |
---|---|---|
0xee | ac83f17b77 |
|
@ -30,14 +30,14 @@ diffEnvs() {
|
|||
local old="$1"
|
||||
local new="$2"
|
||||
|
||||
while read -r -d '' line; do
|
||||
while IFS= read -r -d '' line; do
|
||||
name=$(tr -d '\0' <<<"$line" | head -n1 | cut -f1 -d'=')
|
||||
if ! getByName "$name" "$new" >/dev/null; then
|
||||
echo "export -n '${name}'"
|
||||
fi
|
||||
done <"$old"
|
||||
|
||||
while read -rd $'\0' line; do
|
||||
while IFS= read -rd $'\0' line; do
|
||||
name=$(tr -d '\0' <<<"$line" | head -n1 | cut -f1 -d'=')
|
||||
if getByName "$name" "$old" >/dev/null; then
|
||||
# found in old env, check if values match
|
||||
|
@ -77,6 +77,11 @@ cacheFile=$(getCacheFilePath)
|
|||
|
||||
case $cmd in
|
||||
reload|r)
|
||||
if [[ -n $DIRENV_DIR ]]; then
|
||||
# run self in clean environment (i.e. outside of the current direnv
|
||||
# environment)
|
||||
exec direnv exec /proc "${BASH_SOURCE[0]}" "$@"
|
||||
fi
|
||||
echo "Re-creating cache"
|
||||
mkdir -p "$(dirname ${cacheFile})"
|
||||
dumpEnv > "${cacheFile}.pre"
|
||||
|
|
Loading…
Reference in New Issue