Add dotenv command to load a dotenv file into the current environment

main
Julius Riegel 7 months ago
parent bf305de91e
commit 6375b48c70

@ -54,3 +54,15 @@ export def --wrapped df [...$args] {
^df ...$args | detect columns --guess
}
}
export def --env dotenv [file=".env"] {
if not ($file | path exists) {
err make { msg: $"env file ($file) not found "}
}
( open $file
| lines
| each { parse "{key}={value}" | first | { $in.key: $in.value} }
| reduce --fold {} {|it, acc| $acc | merge $it }
| load-env $in
)
}

@ -62,6 +62,7 @@ config.modules = {
'parallel',
'bat',
'cz-cli',
'plantuml',
},
gui = mod {
'kdePackages.breeze-icons',

Loading…
Cancel
Save