Skip to content

Instantly share code, notes, and snippets.

@lucperkins
Created March 22, 2023 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucperkins/49b7b7e876b9426ef6f7dea70feb900b to your computer and use it in GitHub Desktop.
Save lucperkins/49b7b7e876b9426ef6f7dea70feb900b to your computer and use it in GitHub Desktop.
# Parse the __nu_packages environment variable string, where each
# package path is separate by a space, and convert to a list
let packages = ($env.__nu_packages | split row (char space))
# Convert the list to a colon-separated string
let $packagesPath = (
$packages
| each { |pkg| $"($pkg)/bin" }
| str collect (char esep)
)
# Set the PATH
let-env PATH = $packagesPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment