DEV Community

Discussion on: Creating a smart alternative to 'cd' command

Collapse
 
taikedz profile image
Tai Kedzierski

That's pretty neat !

The only thing is.... why cd "$1" || exit ? If for some reason there's, say, a permission issue on that folder, or a broken symlink, exit will actually terminate your current shell session... surely not the effect you want from a function? Likely this should be return

Collapse
 
bhupesh profile image
Bhupesh Varshney 👾

Yes, I absolutely agree (the thing is I it realized sometime later after I first published the blog)
I have updated it now
thanks for pointing it out 👍