Do not log when user has requested no profile modifications#2131
Do not log when user has requested no profile modifications#2131ljharb merged 1 commit intonvm-sh:masterfrom
Conversation
…ifications [Tests] `install.sh`: add tests for PROFILE=/dev/null profile skip Verify that when PROFILE="/dev/null" is set: - The "Profile not found" warning is suppressed - Profile modification is skipped as expected Co-authored-by: Wes Todd <wes@wesleytodd.com> Co-authored-by: Jordan Harband <ljharb@gmail.com>
|
I looked at the test failures and I am not sure what is up. I tried running them locally before pushing and aborted when it asked for my root password. Is this expected when running |
|
Yes, the tests do require sudo privileges. |
|
Looks like tests are failing due to a breaking change in a minor release: alanshaw/david#159 I'll try to work around that on master before rebasing this. |
|
For tests: the install script has all of its functions unit tested except for I think you could add a new test that explicitly tests the stdout/stderr output and asserts that the profile warning does, or does not, appear when expected? |
|
Awesome, so I am assuming that means you do like the change. I will work on tests for this when I have time. It might be a little bit due to Node Interactive and other things I have planned in Dec, but I won’t abandon it. |
Famous last words! For anyone else seeing this, I think this is a good change and it should just needs some bash tests. Feel free to take it over if you have time before I can get back to this. |
|
(Please don't open a new PR for that, though; please instead comment here with a link to a commit/branch, and I'll pull in the changes) |
a9e89e3 to
493cc16
Compare
🤣 Honestly I was trying to push netflix to adopt nvm and this was a part of that. That work stalled out (reorgs, reprioritization, etc) and I am not sure I will be getting back to it any time soon. As I said above, anyone who wants to take this and run with it is welcome to. |
|
@wesleytodd keep me posted if there's anything i can do in the future to help that adoption. |
c6cfc3a to
c20db2a
Compare
61cb9f7 to
ec8906b
Compare
Currently when you run the following command it will not modify the profile, but it still logs a complaint and asks the user to add it.
This changes the behavior so that explicitly setting to
/dev/nulldoes not nag you again. The change was simple so I figured I would submit a PR rather than an issue to discuss. Also, I looked at writing a test but having really no experience writing tests for a bash app like this I figured I should see if this seems good before spending too much time.