Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Improve idempotence of script #88

Closed
wants to merge 1 commit into from

3 participants

@croaky
Owner

No description provided.

@jferris
Owner

Nice. Looks good to me.

@croaky
Owner

Thanks, @jferris. Merged.

@croaky croaky closed this
@gabebw gabebw commented on the diff
@@ -65,7 +67,11 @@ echo "Installing watch, used to execute a program periodically and show the outp
echo "Installing rbenv for changing Ruby versions ..."
successfully brew install rbenv
- successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+
+ if ! [ grep -qs "rbenv init" ~/.zlogin ]; then
@gabebw Owner
gabebw added a note

Why does this need brackets around the condition but line 25 doesn't?

@croaky Owner
croaky added a note

@gabebw Good catch. They should not have brackets. Removed in 55d9853.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2013
  1. @croaky

    Improve idempotence of script

    croaky authored
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 6 deletions.
  1. +12 −6 mac
View
18 mac
@@ -22,11 +22,13 @@ echo "Installing Homebrew, a good OS X package manager ..."
successfully ruby <(curl -fsS https://raw.github.com/mxcl/homebrew/go)
successfully brew update
-echo "Putting Homebrew location earlier in PATH ..."
- successfully echo "
-# recommended by brew doctor
-export PATH='/usr/local/bin:$PATH'" >> ~/.zshenv
- successfully source ~/.zshenv
+if ! grep -qs "recommended by brew doctor" ~/.zshenv; then
+ echo "Putting Homebrew location earlier in PATH ..."
+ successfully echo "
+ # recommended by brew doctor
+ export PATH='/usr/local/bin:$PATH'" >> ~/.zshenv
+ successfully source ~/.zshenv
+fi
echo "Installing GNU Compiler Collection and dependencies ..."
successfully brew tap homebrew/dupes
@@ -65,7 +67,11 @@ echo "Installing watch, used to execute a program periodically and show the outp
echo "Installing rbenv for changing Ruby versions ..."
successfully brew install rbenv
- successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+
+ if ! [ grep -qs "rbenv init" ~/.zlogin ]; then
@gabebw Owner
gabebw added a note

Why does this need brackets around the condition but line 25 doesn't?

@croaky Owner
croaky added a note

@gabebw Good catch. They should not have brackets. Removed in 55d9853.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ successfully echo 'eval "$(rbenv init -)"' >> ~/.zlogin
+ fi
+
successfully source ~/.zlogin
echo "Installing rbenv-gem-rehash so the shell automatically picks up binaries after installing gems with binaries..."
Something went wrong with that request. Please try again.