-
Notifications
You must be signed in to change notification settings - Fork 913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Correct Nushell source command #4230
base: master
Are you sure you want to change the base?
Conversation
e36dd77
to
064cf6a
Compare
source "{cargo_home}/env.nu" # For nushell | ||
. "{cargo_home}/env" # For sh/bash/zsh/ash/dash/pdksh | ||
source "{cargo_home}/env.fish" # For fish | ||
source $"($nu.home-path)/.cargo/env.nu" # For nushell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is not necessary the $CARGO_HOME
! It's just its default value...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a scenario where $CARGO_HOME is set to a value different than default on a system and a human user will actually read this prompt? Or is it something that's only overriden in CI and such?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Yethal A human user will actually read the prompt. We allow $CARGO_HOME
to be set to something else beforehand, actually IIRC we have suggested in an earlier note (before the actual installation, see https://github.com/search?q=repo%3Arust-lang%2Frustup+%22This+can+be+modified+with+the%22&type=code) that if you want it to be elsewhere you can set that and return to the installer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AIUI if $CARGO_HOME
is something else then this will get out of sync with other commands.
I believe we should add a more friendly note instead of just using the default value, if the equivalent cannot be achieved in nushell.
It looks like we need something like https://www.nushell.sh/cookbook/foreign_shell_scripts.html but I'm not so sure... cc @LittleJianCH |
Nushell uses
$env.HOME
instead of$HOME
syntax for environment variables. However sincesource
is a parser keyword it cannot access environment variables which is why it should use$nu.home-path
insteadAdditionally, the original command will cause nushell to error out on next config evaluation