|
|
|
@ -95,7 +95,19 @@ export def --env dotenv [file=".env"] {
|
|
|
|
|
}
|
|
|
|
|
( open $file
|
|
|
|
|
| lines
|
|
|
|
|
| each { parse "{key}={value}" | first | { $in.key: $in.value} }
|
|
|
|
|
| where $it !~ "^\\s*#.*"
|
|
|
|
|
| each {|line|
|
|
|
|
|
try {
|
|
|
|
|
$line | parse "{key}=\"{value}\"" | first | { $in.key: ($"\"($in.value)\"" | from nuon) }
|
|
|
|
|
} catch {
|
|
|
|
|
try {
|
|
|
|
|
$line | parse "{key}={value}" | first | { $in.key: $in.value }
|
|
|
|
|
} catch {
|
|
|
|
|
null
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
| where $it != null
|
|
|
|
|
| reduce --fold {} {|it, acc| $acc | merge $it }
|
|
|
|
|
| load-env $in
|
|
|
|
|
)
|
|
|
|
|