-1

(this is to document a specific behavior that may affect users mixing windows and wsl for work)

I use a hierarchy of directories with .envrc in them to manage environment.

file content is like

export BASE_URL="url"
source_env_if_exists .terraform-state

First line works, second appears to be not doing anything. source_env_if_exists is direnv library call (https://github.com/direnv/direnv/blob/master/stdlib.sh)

Local environment is WSL2(Ubuntu), where the file is part of directory checked out on windows but used with in WSL

Jayan
  • 18,003
  • 15
  • 89
  • 143

1 Answers1

0

File is edited/cloned from windows leaves line ending in windows style. direnv library leaves that to bash (and does nothing) . Windows WSL - issue with carriege return · Issue #542 · direnv/direnv · GitHub has more details.

Fixing the file (using dos2linux or fresh clone from WSL2 ) worked.

Jayan
  • 18,003
  • 15
  • 89
  • 143