Permalink
Browse files

Merge pull request #493 from gnuwilliam/setup-art

Creating functions for yeoman setup and adding the colored art before the audit
  • Loading branch information...
2 parents 03a13c9 + 0bd9172 commit c0880ebae55ea2b6691c353560dc26eb5717981f @paulirish paulirish committed Sep 18, 2012
Showing with 170 additions and 119 deletions.
  1. +170 −119 setup/install.sh
View
289 setup/install.sh
@@ -63,143 +63,194 @@ desc_print(){
printf "\t%s \e[47m\e[0;35m%s\e[0m %s\n" "$1" "$2" "$3"
}
-
# audit \o/
-echo ""
-echo "Wotcha! Well hi there. "
-echo "Thanks for your interest in Yeoman."
-echo ""
-echo "Below is a quick audit I've run on your system to see if you have everything you need for Yeoman:"
+audit() {
+ echo ""
+ echo "Wotcha! Well hi there. "
+ echo "Thanks for your interest in Yeoman."
+ echo ""
+ echo "Below is a quick audit I've run on your system to see if you have everything you need for Yeoman:"
-if [[ $mac = 1 ]]; then
- # xcode cli test.
- cli=$(check_set $clangfile)
+ if [[ $mac = 1 ]]; then
+ # xcode cli test.
+ cli=$(check_set $clangfile)
- # brew test.
- brew=$(check_set $brewfile)
-fi
+ # brew test.
+ brew=$(check_set $brewfile)
+ fi
-if [[ $linux = 1 ]]; then
- # curl test.
- curl=$(check_set $curlfile)
-fi
+ if [[ $linux = 1 ]]; then
+ # curl test.
+ curl=$(check_set $curlfile)
+ fi
-# node test
-node=$(check_set $nodefile)
-if [[ $node == 1 ]]; then
- nodever=$(node -e 'console.log(process.versions.node);')
- # node version check
- if [[ "$nodever" < "$reqnode" ]]; then
- node=2
+ # node test
+ node=$(check_set $nodefile)
+ if [[ $node == 1 ]]; then
+ nodever=$(node -e 'console.log(process.versions.node);')
+ # node version check
+ if [[ "$nodever" < "$reqnode" ]]; then
+ node=2
+ fi
fi
-fi
-# ruby test
-ruby=$(check_set $rubyfile)
-if [[ $ruby == 1 ]]; then
- rubyver=$(ruby -e 'print RUBY_VERSION')
- # ruby version check
- if [[ "$rubyver" < "$reqruby" ]]; then
- ruby=2
+ # ruby test
+ ruby=$(check_set $rubyfile)
+ if [[ $ruby == 1 ]]; then
+ rubyver=$(ruby -e 'print RUBY_VERSION')
+ # ruby version check
+ if [[ "$rubyver" < "$reqruby" ]]; then
+ ruby=2
+ fi
fi
-fi
-# compass test
-compass=$(check_set $compassfile)
-if [[ $compass == 1 ]];then
- compassver=$(compass -qv)
- # compass version check
- if [[ "$compassver" < "$reqcompass" ]]; then
- compass=2
+ # compass test
+ compass=$(check_set $compassfile)
+ if [[ $compass == 1 ]];then
+ compassver=$(compass -qv)
+ # compass version check
+ if [[ "$compassver" < "$reqcompass" ]]; then
+ compass=2
+ fi
fi
-fi
-git=$(check_set $gitfile)
-gem=$(check_set $gemfile)
-phantomjs=$(check_set $phantomjsfile)
-jpegturbo=$(check_set $jpegturbofile)
-optipng=$(check_set $optipngfile)
-yeoman=$(check_set $yeomanfile)
+ git=$(check_set $gitfile)
+ gem=$(check_set $gemfile)
+ phantomjs=$(check_set $phantomjsfile)
+ jpegturbo=$(check_set $jpegturbofile)
+ optipng=$(check_set $optipngfile)
+ yeoman=$(check_set $yeomanfile)
-# display results
-#
-# results logic
-# passes first
-# fails second
+ # display results
+ #
+ # results logic
+ # passes first
+ # fails second
-echo ""
+ echo ""
-# passes
-if [[ "$mac" = 1 ]]; then
- [ "$cli" -eq 1 ] && happy_print "Command Line Tools for Xcode" "are installed! "
- [ "$brew" -eq 1 ] && happy_print "Homebrew" "is installed."
-fi
+ # passes
+ if [[ "$mac" = 1 ]]; then
+ [ "$cli" -eq 1 ] && happy_print "Command Line Tools for Xcode" "are installed! "
+ [ "$brew" -eq 1 ] && happy_print "Homebrew" "is installed."
+ fi
-if [[ "$linux" = 1 ]]; then
- [ "$curl" -eq 1 ] && happy_print "curl" "is present, phew."
-fi
+ if [[ "$linux" = 1 ]]; then
+ [ "$curl" -eq 1 ] && happy_print "curl" "is present, phew."
+ fi
-[ "$git" -eq 1 ] && happy_print "git" "is installed, nice one."
-[ "$node" -eq 1 ] && happy_print "NodeJS" "is installed."
-[ "$ruby" -eq 1 ] && happy_print "ruby" "is installed."
-[ "$gem" -eq 1 ] && happy_print "RubyGems" "is installed."
-[ "$compass" -eq 1 ] && happy_print "Compass" "is installed."
-[ "$phantomjs" -eq 1 ] && happy_print "PhantomJS" "is installed."
-[ "$jpegturbo" -eq 1 ] && happy_print "jpegtran" "is installed."
-[ "$optipng" -eq 1 ] && happy_print "optipng" "is installed."
-[ "$yeoman" -eq 1 ] && happy_print "yeoman global npm module" "... installed!"
-
-# failures
-if [[ "$mac" = 1 ]]; then
- [ "$cli" -eq 0 ] && \
- sad_print "Command Line Tools for Xcode" "" && \
- desc_print "Visit http://stackoverflow.com/a/9329325/89484 for installation options."
- [ "$brew" -eq 0 ] && \
- sad_print "Homebrew" "" && \
- desc_print "Install Homebrew from the instructions at https://github.com/mxcl/homebrew/wiki/Installation " && \
- desc_print "For best results, after install, be sure to run" "brew doctor" "and follow the recommendations."
-fi
+ [ "$git" -eq 1 ] && happy_print "git" "is installed, nice one."
+ [ "$node" -eq 1 ] && happy_print "NodeJS" "is installed."
+ [ "$ruby" -eq 1 ] && happy_print "ruby" "is installed."
+ [ "$gem" -eq 1 ] && happy_print "RubyGems" "is installed."
+ [ "$compass" -eq 1 ] && happy_print "Compass" "is installed."
+ [ "$phantomjs" -eq 1 ] && happy_print "PhantomJS" "is installed."
+ [ "$jpegturbo" -eq 1 ] && happy_print "jpegtran" "is installed."
+ [ "$optipng" -eq 1 ] && happy_print "optipng" "is installed."
+ [ "$yeoman" -eq 1 ] && happy_print "yeoman global npm module" "... installed!"
+
+ # failures
+ if [[ "$mac" = 1 ]]; then
+ [ "$cli" -eq 0 ] && \
+ sad_print "Command Line Tools for Xcode" "" && \
+ desc_print "Visit http://stackoverflow.com/a/9329325/89484 for installation options."
+ [ "$brew" -eq 0 ] && \
+ sad_print "Homebrew" "" && \
+ desc_print "Install Homebrew from the instructions at https://github.com/mxcl/homebrew/wiki/Installation " && \
+ desc_print "For best results, after install, be sure to run" "brew doctor" "and follow the recommendations."
+ fi
-if [[ "$linux" = 1 ]]; then
- [ "$curl" -eq 0 ] && sad_print "curl"
-fi
+ if [[ "$linux" = 1 ]]; then
+ [ "$curl" -eq 0 ] && sad_print "curl"
+ fi
+
+ [ "$git" -eq 0 ] && \
+ sad_print "git" "" && \
+ desc_print "Install through your package manager. " && \
+ desc_print "For example, with homebrew:" "brew install git"
+ [ "$node" -eq 0 ] && \
+ sad_print "NodeJS" "" && \
+ desc_print "I recommend you grab a fresh NodeJS install (>= 0.8.x) from http://nodejs.org/download/ "
+ [ "$ruby" -eq 0 ] && \
+ sad_print "ruby" "" && \
+ desc_print "Check your ruby with" "ruby -v" "(>= 1.8.7 required) and install http://www.ruby-lang.org/en/downloads/"
+ [ "$gem" -eq 0 ] && \
+ sad_print "RubyGems" "" && \
+ desc_print "You'll pick this up with your ruby installation. "
+ [ "$compass" -eq 0 ] && \
+ sad_print "Compass" "" && \
+ desc_print "is not installed: http://compass-style.org/install/ "
+ [ "$phantomjs" -eq 0 ] && \
+ sad_print "PhantomJS" "" && \
+ desc_print "Follow instructions at http://phantomjs.org/download.html - the binary installs are quick!"
+ [ "$jpegturbo" -eq 0 ] && \
+ sad_print "jpegtran" "" && \
+ desc_print "On Mac," "brew install jpeg-turbo && brew link jpeg-turbo" "should do the trick."
+ [ "$optipng" -eq 0 ] && \
+ sad_print "optipng" "" && \
+ desc_print "On Mac," "brew install optipng" "will sort you out."
+ [ "$yeoman" -eq 0 ] && \
+ sad_print "yeoman" "" && \
+ desc_print "You're missing yeoman!" "npm install -g yeoman" "will sort you out. You may need sudo."
+
+
+
+ echo ""
+ echo "Help me out and install anything that's missing above. Additional help at http://goo.gl/XoyWI "
+ echo ""
+ printf "%s \e[47m\e[0;35m%s\e[0m %s\n" "Once you've ensured all of the above dependencies are present, we can start up Yeoman. Type" "yeoman" "at your prompt to get started."
+ echo ""
+}
+
+# yeoman art.
+
+art() {
+ echo "                                                                                
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+                                                                                 
+ "
+}
-[ "$git" -eq 0 ] && \
- sad_print "git" "" && \
- desc_print "Install through your package manager. " && \
- desc_print "For example, with homebrew:" "brew install git"
-[ "$node" -eq 0 ] && \
- sad_print "NodeJS" "" && \
- desc_print "I recommend you grab a fresh NodeJS install (>= 0.8.x) from http://nodejs.org/download/ "
-[ "$ruby" -eq 0 ] && \
- sad_print "ruby" "" && \
- desc_print "Check your ruby with" "ruby -v" "(>= 1.8.7 required) and install http://www.ruby-lang.org/en/downloads/"
-[ "$gem" -eq 0 ] && \
- sad_print "RubyGems" "" && \
- desc_print "You'll pick this up with your ruby installation. "
-[ "$compass" -eq 0 ] && \
- sad_print "Compass" "" && \
- desc_print "is not installed: http://compass-style.org/install/ "
-[ "$phantomjs" -eq 0 ] && \
- sad_print "PhantomJS" "" && \
- desc_print "Follow instructions at http://phantomjs.org/download.html - the binary installs are quick!"
-[ "$jpegturbo" -eq 0 ] && \
- sad_print "jpegtran" "" && \
- desc_print "On Mac," "brew install jpeg-turbo && brew link jpeg-turbo" "should do the trick."
-[ "$optipng" -eq 0 ] && \
- sad_print "optipng" "" && \
- desc_print "On Mac," "brew install optipng" "will sort you out."
-[ "$yeoman" -eq 0 ] && \
- sad_print "yeoman" "" && \
- desc_print "You're missing yeoman!" "npm install -g yeoman" "will sort you out. You may need sudo."
-
-
-
-echo ""
-echo "Help me out and install anything that's missing above. Additional help at http://goo.gl/XoyWI "
-echo ""
-printf "%s \e[47m\e[0;35m%s\e[0m %s\n" "Once you've ensured all of the above dependencies are present, we can start up Yeoman. Type" "yeoman" "at your prompt to get started."
-echo ""
+# function calls.
+art
+audit

0 comments on commit c0880eb

Please sign in to comment.