Last active
January 6, 2025 20:22
-
-
Save Fishrock123/c9274955cb0ead6a2d2c2b0717170e21 to your computer and use it in GitHub Desktop.
from_bash_env.nu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def from_bash_env []: string -> record { $in | str replace -amr '(&&)|(\r\n)|\n|;' "\n" | lines -s | str trim | parse --regex `export [\'\"]?(?<name>[^\'\"=]+)[\'\"]?=[\'\"]?(?<value>[^\'\"\n]+)[\"\']?` | transpose -ird } | |
# command | from_bash-env | load-env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment