Git Product home page Git Product logo

Comments (2)

filaretov avatar filaretov commented on July 29, 2024

#188 adds an example for pathvar add in the table, but perhaps we should add a Path section to the Environment page in the book? I'm currently documenting nushell/nushell#3950 on that page and I would gladly add information about working with the path env var as well.

from nushell.github.io.

filaretov avatar filaretov commented on July 29, 2024

In general, we could use some more information about manipulating the PATH in Nu.

We currently have pathvar, which makes it very easy to add and remove specific paths. However, it is also possible to change the path by setting a value to the PATH env var (or Path on Windows). I don't know if this is intended or not?

> pathvar add ~/.local/bin
# works!

> let-env PATH = (pathvar | prepend ("~/.local/bin" | path expand) | str collect ":")
# also works!

Both of the above do the same thing. The second one is closer to what we usually see in other shells (and can be done with string concatenation to make it resemble that pattern even more).

Setting the PATH all at once as a string has its use cases, like restoring an old PATH when you don't know the number of elements you would like to remove. This happens when you're working with some virtual environments that add more than one path element.

I would like to document this, if it's intended to work like this.

from nushell.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.