From d9b11ba20843c8bc10772157571a67b9076b7ba5 Mon Sep 17 00:00:00 2001 From: farmer <1153595464@qq.com> Date: Fri, 19 Feb 2021 21:12:03 +0800 Subject: [PATCH] [readme] update `cdnvm` implementation --- README.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index e6a99c2..c41d0f8 100644 --- a/README.md +++ b/README.md @@ -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