We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
\n
1 parent b42f2bd commit d22181fCopy full SHA for d22181f
modules/formats/from-env.nu
@@ -2,10 +2,13 @@
2
# may be used like this: open .env | load-env
3
# works with quoted and unquoted .env files
4
def "from env" []: string -> record {
5
- lines
+ lines
6
| split column '#' # remove comments
7
- | get column1
+ | get column1
8
| parse "{key}={value}"
9
- | str trim value -c '"' # unquote values
+ | update value {
10
+ str trim -c '"' | # unquote values
11
+ str replace -a "\\n" "\n" # replace `\n` with newline char
12
+ }
13
| transpose -r -d
14
}
0 commit comments