Skip to content

Instantly share code, notes, and snippets.

@willbowling
Created April 14, 2015 15:58
Show Gist options
  • Save willbowling/f2dece0ae2b96e3e5ac5 to your computer and use it in GitHub Desktop.
Save willbowling/f2dece0ae2b96e3e5ac5 to your computer and use it in GitHub Desktop.
Shell Script - Machine Environment Setup
#!/bin/bash
# The following script will install libraries that are required to test on your machine. If you are using vagrant to bring up
# twc dev VM, please execute this file outside of VM.
# Author: ksankaran (Velu)
echo "Un-Installing grunt +++++++++++++++++++++++++++++"
sudo npm uninstall -g grunt-cli
echo "Un-Installing phantomjs +++++++++++++++++++++++++"
npm uninstall phantomjs
echo "Un-Installing node ++++++++++++++++++++++++++++++"
npm uninstall node
echo "Un-Installing npm +++++++++++++++++++++++++++++++"
sudo npm uninstall npm -g
# Create homebrew on the machine.
if [ ! -f /usr/local/bin/brew ]; then
echo "Installing Homebrew (brew) +++++++++++++++++++++++++++++++"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo "Updating Homebrew (brew) +++++++++++++++++++++++++++++++++"
brew update
fi
if [ ! -f /usr/local/bin/node ]; then
echo "Installing node +++++++++++++++++++++++++"
brew install node
fi
if [ ! -f /usr/local/bin/npm ]; then
echo "Installing npm +++++++++++++++++++++++++"
sh npm_installer.sh
fi
if [ ! -f /usr/local/bin/grunt ]; then
if [ ! -f /usr/local/share/npm/bin/grunt ]; then
echo "Installing Grunt +++++++++++++++++++++++++"
sudo npm install -g grunt-cli
fi
fi
if [ ! -f /usr/local/bin/phantomjs ]; then
if [ ! -f /usr/local/share/npm/bin/phantomjs ]; then
echo "Installing Phantomjs +++++++++++++++++++++++++"
npm install phantomjs
fi
fi
if [ ! -f /usr/local/bin/yo ]; then
echo "Installing Yeoman (Yo) +++++++++++++++++++++++++"
sudo npm install -g yo
fi
#!/bin/bash
# The following script will UPDATE the Yeoman Generator and required GEM libraries on your machine.
#
# Author: wbowling (Will)
# echo "Checking / Updating Ruby Gems +++++++++++++++++++++++++++++++++++++"
# Install Xcode Devtools
# xcode-select --install
# Gem install compass and other dependencies
# sudo gem update
# sudo gem update --system
if ! gem query --name-matches 'sass' --installed --version 3.2.12; then
echo "Installing sass +++++++++++++++++++++++++"
sudo gem install sass -v 3.2.12
fi
if ! gem query --name-matches 'compass' --installed --version 0.12.2; then
echo "Installing compass +++++++++++++++++++++++++"
sudo gem install compass -v 0.12.2
fi
if ! gem query --name-matches 'toolkit' --installed --version 1.3.8; then
echo "Installing toolkit +++++++++++++++++++++++++"
sudo gem install toolkit -v 1.3.8
fi
if ! gem query --name-matches 'breakpoint' --installed --version 2.0.7; then
echo "Installing breakpoint +++++++++++++++++++++++++"
sudo gem install breakpoint -v 2.0.7
fi
if ! gem query --name-matches 'bundler' --installed --version 1.3.5; then
echo "Installing bundler +++++++++++++++++++++++++"
sudo gem install bundler -v 1.3.5
fi
if ! gem query --name-matches 'sass-globbing' --installed --version 1.1.0; then
echo "Installing sass-globbing +++++++++++++++++++++++++"
sudo gem install sass-globbing -v 1.1.0
fi
if ! gem query --name-matches 'compass-normalize' --installed --version 1.4.3; then
echo "Installing compass-normalize +++++++++++++++++++++++++"
sudo gem install compass-normalize -v 1.4.3
fi
if ! gem query --name-matches 'compass-rgbapng' --installed --version 0.2.1; then
echo "Installing compass-rgbapng +++++++++++++++++++++++++"
sudo gem install compass-rgbapng -v 0.2.1
fi
if ! gem query --name-matches 'listen' --installed; then
echo "Installing listen +++++++++++++++++++++++++"
sudo gem install listen
fi
if ! gem query --name-matches 'guard' --installed; then
echo "Installing guard +++++++++++++++++++++++++"
sudo gem install guard
fi
# if ! gem query --name-matches 'compass-validator' --installed --version 3.0.1; then
# echo "Installing compass-validator +++++++++++++++++++++++++"
# sudo gem install compass-validator -v 3.0.1
# fi
# if ! gem query --name-matches 'singularitygs' --installed --version 1.1.2; then
# echo "Installing singularitygs +++++++++++++++++++++++++"
# sudo gem install singularitygs -v 1.1.2
# fi
# if ! gem query --name-matches 'oily_png' --installed --version 1.1.0; then
# echo "Installing oily_png +++++++++++++++++++++++++"
# sudo gem install oily_png -v 1.1.0
# fi
# if ! gem query --name-matches 'css_parser' --installed --version 1.3.5; then
# echo "Installing css_parser +++++++++++++++++++++++++"
# sudo gem install css_parser -v 1.3.5
# fi
# if ! gem query --name-matches 'yajl-ruby' --installed --version 1.1.0; then
# echo "Installing yajl-ruby +++++++++++++++++++++++++"
# sudo gem install yajl-ruby -v 1.1.0
# fi
# echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Ruby Gem UPDATE Complete!!! +++++++++++++++++++++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Updating Yeoman TWC Module Generator ++++++++++++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
npm install -g git+ssh://gitolite@git0b00.dev.weather.com:web/generator-twc#v0.1.5
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Yeoman TWC Module Generator UPDATE Complete!!! ++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "UPDATING project specific dependencies ++++++++++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
cd ../
npm install
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "UPDATE Complete!!! Happy Coding +++++++++++++++++++++++++++"
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
@willbowling
Copy link
Author

Also requires the npm-installer.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment