Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@thegallagher
Created July 28, 2016 08:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save thegallagher/ed0d10e1d08079d148f5739ddb1c6403 to your computer and use it in GitHub Desktop.
Save thegallagher/ed0d10e1d08079d148f5739ddb1c6403 to your computer and use it in GitHub Desktop.
Install web development tools on Ubuntu 16.04
#!/bin/bash
# Git
sudo apt-get -y install git
# Node.js
sudo apt-get -y install nodejs
sudo apt-get -y install npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
# Composer
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
# PHP CodeSniffer
sudo pear install --alldeps php_codesniffer
# Bower
sudo npm install -g bower
# Grunt
sudo npm install -g grunt-cli
# Gulp
sudo npm install --global gulp
# WP CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Configure SSH
echo "Creating SSH key..."
if [ ! -f ~/.ssh/id_rsa ]; then
ssh-keygen -f ~/.ssh/id_rsa -N ""
else
echo "SSH key already exists"
fi
# Configure Git
echo "Configuring git..."
git config --get user.name > /dev/null
if [ $? != 0 ]; then
echo -n "Enter your name: "
read name
git config --global user.name "$name"
else
echo "Name already set."
fi
git config --get user.email > /dev/null
if [ $? != 0 ]; then
echo -n "Enter your email: "
read email
git config --global user.email "$email"
else
echo "Email already set."
fi
# Finished
echo "Finished"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment