Skip to content

Commit

Permalink
.envrc should only be SRCROOT if we otherwise don’t find one
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Mar 14, 2023
1 parent 0155358 commit 0de95a1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hooks/useVirtualEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export default async function(cwd: Path = Path.cwd()): Promise<VirtualEnv> {
if (_if_d(".hg", ".svn")) {
srcroot ??= f
}
if (_if(".envrc")) {
if ((f = dir.join(".envrc").isFile())) {
//TODO really we should pkg `direnv` install it if we find this file and configure it to do the following
const subst = Deno.env.toObject()
subst.SRCROOT = "{{srcroot}}"
Expand All @@ -200,6 +200,7 @@ export default async function(cwd: Path = Path.cwd()): Promise<VirtualEnv> {
}
env[key] = value
}
srcroot ??= f
}
}
}
Expand Down

0 comments on commit 0de95a1

Please sign in to comment.