Skip to content
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

Override cd, without stepping on RVM #4373

Open
ORESoftware opened this issue May 2, 2018 · 1 comment
Open

Override cd, without stepping on RVM #4373

ORESoftware opened this issue May 2, 2018 · 1 comment

Comments

@ORESoftware
Copy link

ORESoftware commented May 2, 2018

I noticed that RVM overrides the cd command:

shopt -s extdebug
declare -F cd
shopt -u extdebug

the above yields:

cd 14 /Users/alexamil/.rvm/scripts/cd

my question for you is - I want to override the cd command, using a bash function like so:

cd(){
 builtin cd "$@"
 echo "do my own thing"
}

but how do I avoid breaking RVM, or something else that overrides cd before I do?

@robertwenner
Copy link

Don't worry about breaking rvm, it already breaks your code. :-(

If you already have a function cd that does something, rvm just clobbers it, silently overwrites it, and leaves you to wonder why your trust scripts magically stopped working when you installed rvm for a completely unrelated project.

I guess you just have to pick whether you want your code to run or rvm's and clobber the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants