Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fixed an issue where including `export` in .env files caused parsing errors. (#6629)
2 changes: 2 additions & 0 deletions src/functions/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const RESERVED_KEYS = [
const LINE_RE = new RegExp(
"^" + // begin line
"\\s*" + // leading whitespaces
"(?:export)?" + // Optional 'export' in a non-capture group
"\\s*" + // more whitespaces
"([\\w./]+)" + // key
"\\s*=[\\f\\t\\v]*" + // separator (=)
"(" + // begin optional value
Expand Down
5 changes: 5 additions & 0 deletions src/test/functions/env.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ describe("functions/env", () => {
input: "FOO=foo ",
want: { FOO: "foo" },
},
{
description: "should parse exported values",
input: "export FOO=foo",
want: { FOO: "foo" },
},
{
description: "should parse values with trailing spaces (single quotes)",
input: "FOO='foo' ",
Expand Down