nushell dump

This commit is contained in:
Bloxx12 2025-07-15 21:31:31 +02:00
commit 655dfe3d48
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E
6 changed files with 187 additions and 206 deletions

23
nushell/source_profile.nu Executable file
View file

@ -0,0 +1,23 @@
#! /usr/bin/env nu
let env_vars_file = '/tmp/nushell-env-vars'
if not ($env_vars_file | path exists) {
open /etc/profile
| lines
| select 11
| str trim
| split column ' ' del path
| get path.0
| open $in
| str trim
| lines
| parse 'export {name}="{value}"'
| transpose --header-row --as-record
| tee {load-env $in}
| to nuon
| save --force $env_vars_file
} else {
open $env_vars_file
| from nuon
| load-env $in
}