Skip to content

Commit

Permalink
[readme] update cdnvm implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
farmer authored and ljharb committed Feb 19, 2021
1 parent 87f3790 commit d9b11ba
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,17 +503,9 @@ If you prefer a lighter-weight solution, the recipes below have been contributed
Put the following at the end of your `$HOME/.bashrc`:

```bash
find-up() {
path=$(pwd)
while [[ "$path" != "" && ! -e "$path/$1" ]]; do
path=${path%/*}
done
echo "$path"
}

cdnvm() {
cd "$@";
nvm_path=$(find-up .nvmrc | tr -d '\n')
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')

# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then
Expand Down

0 comments on commit d9b11ba

Please sign in to comment.