nushell dump
This commit is contained in:
parent
25483702ac
commit
655dfe3d48
6 changed files with 187 additions and 206 deletions
23
nushell/source_profile.nu
Executable file
23
nushell/source_profile.nu
Executable 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue