Skip to content

Commit

Permalink
Be defensive with .envrc
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Feb 14, 2023
1 parent e2198f5 commit 3f0cdcd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ the creator of [`brew`].
 


# tea/cli 0.24.2
# tea/cli 0.24.3

```sh
$ node --eval 'console.log("Hello World!")'
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useVirtualEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export default async function(cwd: Path = Path.cwd()): Promise<VirtualEnv> {
subst.VERSION = "{{version}}"
for await (const line of f!.readLines()) {
let [,key,value] = line.match(/^export (\S+)=(.*)$/) ?? []
for (const [key, value_subst] of Object.entries(subst)) {
if (key && value) for (const [key, value_subst] of Object.entries(subst)) {
value = value.replaceAll(`$${key}`, value_subst)
}
env[key] = value
Expand Down

0 comments on commit 3f0cdcd

Please sign in to comment.