rubymaniac / vscode-direnv

Automatically detect and load your .envrc
MIT License
32 stars 11 forks source link

Load .envrc from parent directories #6

Open DAddYE opened 6 years ago

DAddYE commented 6 years ago

Hi,

Loading a .envrc from a parent directory is possible? Currently, the shell one is able to do so, but this plugin seems it's not.

direnv: loading ../../../../.envrc
direnv: export +JAVA_HOME ~GOPATH ~PATH
chrish42 commented 4 years ago

As an example use case. I am working on Apache Arrow, whose Git repo has multiple projects (e.g. cpp, python) as sub-directories of the top-level directory. I set Arrow-wide environment variables in the .envrc of the top-level directory, but then I'm working on the C++ side, so I open arrow/cpp in VS Code. Then the plugin doesn't see the top-level arrow/.envrc, and doesn't set those environment variables.

gullitmiranda commented 3 years ago

@DAddYE i load the parent envrc through the local envrc. so the behavior is the same in any environment.

my default content of .envrc file:

#!/bin/bash

# load parent .envrc - https://github.com/direnv/direnv/blob/288c07b1fed27eb19c43e210c205cd6e806ffa07/man/direnv-stdlib.1.md#source_up-filename
# NOTE: the other .envrc is not checked by the security framework.
source_up .envrc

# ...
DAddYE commented 3 years ago

Quite possible the issue has been fixed (was open in 2018), and yes, seems working properly now.

arulrajnet commented 2 years ago

This can be closed.