Skip to content
This repository

Printing 'Running hooks/after_cd' when logging in #1021

Closed
bronson opened this Issue June 19, 2012 · 4 comments

2 participants

Scott Bronson Michal Papis
Scott Bronson

RVM prints Running /usr/local/rvm/hooks/after_cd when sshing into my web server and changing directories. Happens 100% of the time.

Not a big deal, just trying to help figure out what's going on. Probably related to #995 and http://stackoverflow.com/questions/10751391/why-am-i-seeing-this-running-after-cd-message-in-the-latest-version-of-rvm

How to reproduce

If you have a host with a directory that has an .rvmrc, try this:

ssh -A host.example.com -t 'cd dir-with-rvmrc && bash --login'

My .rvmrc just contains rvm use ruby-1.9.3. This gets printed before getting a login shell:

Using /usr/local/rvm/gems/ruby-1.9.3-p194
Using /usr/local/rvm/gems/ruby-1.9.3-p194
Running /usr/local/rvm/hooks/after_cd
Scott Bronson

Heck with all the jazz above. To see the message, just cd to a directory that contains an .rvmrc and run bash.

$ cd myproject
Using /Users/bronson/.rvm/gems/ruby-1.9.3-p194
$ bash
Using /Users/bronson/.rvm/gems/ruby-1.9.3-p194
Running /Users/bronson/.rvm/hooks/after_cd
$ exit
Michal Papis
Collaborator
mpapis commented June 19, 2012

this is expected behavior as rvm use sets rvm_verbose_flag=1 and https://github.com/wayneeseguin/rvm/blob/master/scripts/hook#L21 checks for it - so it will be printed, this script was not available in earlier versions of rvm and that's why it was not printed ...

I guess this should be fixed by moving parts of the logic from after_cd to hooks

Michal Papis
Collaborator

rescheduling to 2.0 for reworking (fixing) the hooks mechanism

Michal Papis mpapis closed this in 996b8cc September 13, 2012
Michal Papis
Collaborator

you were getting double Using because of the second bash --login - the first one was done by ssh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.