On my Ubuntu machine, I have a lot of javascript / typescript projects.Each of npm's binary might have a global installation, like tsc at~/.nvm/versions/node/v7.10.0/bin/tsc$ tsc -vVersion 2.4.2and it each project will define its own binary at:~/src/project/node_modules/.bin/tsc $ cd ~/src/project && ./node_modules/.bin/tsc -vVersion 2.3.4   I have a lot of nodejs / typescript projects, and whenever I call a command, e.g. tsc, I always want to run the project's as the first choice, and only then fallback to the global installation.I know that npm scripts will always call the command from ./node_modules/.bin/ and hence setting up scripts like:$ jq .scripts package.json {  test: mocha --compilers js:babel-register --recursive tests/unit,  start: node start.js,  start-dev: nodemon start.js,  tslint: tslint 'src/**/*.ts?(x)' --fix,  tsc: tsc}would suffice. I could then call:> pink_elephant@1.0.0 tsc /home/philipp/myProject> tsc -vVersion 2.3.4   Yet not all my projects have these scripts defined, and I find handling the arguments via -- annoying. So in order of making my life as a developer easier, I like to define my path in a way, that whenever I:cd someProjectFolderit looks for the existence of:./node_modules/.bin/and if it exists, add it to the path of the current shell.How can I achieve this?
How to check if a subfolder exists and if so add it to the path automatically on cd?
bash;path;cd command