File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,9 @@ _bash-it-update-stable() {
195195}
196196
197197_bash-it_pull_and_update_inner () {
198+ _param ' 1: Which branch to checkout to'
199+ _param ' 2: Which type of version we are using'
200+ _param ' 3: Old pwd to restore'
198201 git checkout " $1 " & > /dev/null
199202 if [[ $? -eq 0 ]]; then
200203 echo " Bash-it successfully updated."
@@ -203,7 +206,9 @@ _bash-it_pull_and_update_inner() {
203206 _bash-it-migrate
204207 echo " "
205208 echo " All done, enjoy!"
206- bash-it restart
209+ # Don't forget to restore the original pwd!
210+ cd " $3 " & > /dev/null
211+ _bash-it-restart
207212 else
208213 echo " Error updating Bash-it, please, check if your Bash-it installation folder (${BASH_IT} ) is clean."
209214 fi
@@ -284,12 +289,12 @@ _bash-it-update-() {
284289
285290 if [[ $silent ]]; then
286291 echo " Updating to ${TARGET} ($( git log -1 --format=%h " ${TARGET} " ) )..."
287- _bash-it_pull_and_update_inner $TARGET $version
292+ _bash-it_pull_and_update_inner $TARGET $version $old_pwd
288293 else
289294 read -e -n 1 -p " Would you like to update to ${TARGET} ($( git log -1 --format=%h " ${TARGET} " ) )? [Y/n] " RESP
290295 case $RESP in
291296 [yY]|" " )
292- _bash-it_pull_and_update_inner $TARGET $version
297+ _bash-it_pull_and_update_inner $TARGET $version $old_pwd
293298 ;;
294299 [nN])
295300 echo " Not updating…"
You can’t perform that action at this time.
0 commit comments