Skip to content

Instantly share code, notes, and snippets.

@jcanfield
Created October 27, 2016 01:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcanfield/a5ec22eb890cb185d574d44f93f34e92 to your computer and use it in GitHub Desktop.
Save jcanfield/a5ec22eb890cb185d574d44f93f34e92 to your computer and use it in GitHub Desktop.
A small bashscript to setup an web-development environment with gulp, bower, nodejs in Ubuntu/Ubuntu-based distributions. !!! Be careful: I recommend to only use it on a fresh installed system, otherwise it could mess up something !!!
#!/bin/bash
# Echo to nowhere for a more beautiful console output
sudo echo > /dev/null
# Add nodejs and sublime text ppa
echo ':: adding ppas'
sudo add-apt-repository -y ppa:chris-lea/node.js > /dev/null 2>&1
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3 > /dev/null 2>&1
# Update repository
echo ':: updating package list'
sudo apt-get update > /dev/null 2>&1
# Install packages
echo ':: installing packages'
sudo apt-get install -y -qq git nodejs ruby sublime-text-installer > /dev/null 2>&1
# Configure package managers
echo ':: configuring package managers'
if [ ! -f ~/.bashrc ]; then
touch ~/.bashrc
fi
echo 'export PATH=$HOME/.node_modules/bin:$HOME/.gem/ruby/1.9.1/bin:$PATH' | cat - ~/.bashrc > /tmp/_bashrc && mv /tmp/_bashrc ~/.bashrc
source ~/.bashrc
echo 'gem: --user-install' > ~/.gemrc
npm config set prefix ~/.node_modules
# Install rubygems
echo ':: installing rubygems'
gem install -q sass > /dev/null 2>&1
# Install node modules
echo ':: installing node modules ... (this will take a while)'
npm install npm --prefix=~/.node_modules -g > /dev/null 2>&1
npm install -g --silent gulp bower yo vtop generator-gulp-webapp > /dev/null 2>&1
# Done
echo ':: everything is done'
echo ':: now open a new terminal and have fun!'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment