Skip to content

Commit

Permalink
eliminated unnecessary cd and failing substitution
Browse files Browse the repository at this point in the history
Changing the working directory in a sub-subshell
does not change the working directory of the executing
shell.

The substitution was broken for me on _all_ my machines,
so I started looking into the business.
  • Loading branch information
Marcus Müller committed Apr 29, 2013
1 parent b6ea876 commit 39b46f5
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions tools/upgrade.sh
@@ -1,8 +1,5 @@
current_path=`pwd`
current_path=${current_path/ /\\ }
printf '\033[0;34m%s\033[0m\n' "Upgrading Oh My Zsh"
cd "$ZSH"

if git pull origin master
then
printf '\033[0;32m%s\033[0m\n' ' __ __ '
Expand All @@ -17,4 +14,3 @@ else
printf '\033[0;31m%s\033[0m\n' 'There was an error updating. Try again later?'
fi

cd "$current_path"

4 comments on commit 39b46f5

@mhumeSF
Copy link

@mhumeSF mhumeSF commented on 39b46f5 May 3, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@zertrin
Copy link

@zertrin zertrin commented on 39b46f5 May 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! this commit fixes issue ohmyzsh#1786: upgrade.sh: Bad substitution.

@shime
Copy link

@shime shime commented on 39b46f5 May 5, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for both changes, saving directory here is irrelevant.

@JensRantil
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can, too, verify that this fixes ohmyzsh#1786. See ohmyzsh#1786 (comment).

Please sign in to comment.