From f2a43c55546a2025a4c4aea8f325c934cdbe5236 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=BCrlimann=20=28CyT=29?= Date: Mon, 13 Apr 2015 11:13:15 +0200 Subject: [PATCH] Add 'cd -' to proposed steps to upgrade ruby-build When a target is not found, rbenv-install proposes pulling changes from upstream. This involves changing the directory to the ruby-build checkout. This patch adds a '&& cd -' to change the working directory back to where we've been. Should work on at least Bash and Zsh. --- bin/rbenv-install | 2 +- test/rbenv.bats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/rbenv-install b/bin/rbenv-install index 543b709b..a2ebffed 100755 --- a/bin/rbenv-install +++ b/bin/rbenv-install @@ -211,7 +211,7 @@ if [ "$STATUS" == "2" ]; then echo " brew update && brew upgrade ruby-build" elif [ -d "${here}/.git" ]; then printf ":\n\n" - echo " cd ${here} && git pull" + echo " cd ${here} && git pull && cd -" else printf ".\n" fi diff --git a/test/rbenv.bats b/test/rbenv.bats index b51ed167..4417232d 100644 --- a/test/rbenv.bats +++ b/test/rbenv.bats @@ -69,7 +69,7 @@ See all available versions with \`rbenv install --list'. If the version you need is missing, try upgrading ruby-build: - cd ${BATS_TEST_DIRNAME}/.. && git pull + cd ${BATS_TEST_DIRNAME}/.. && git pull && cd - OUT unstub ruby-build