Skip to content

Instantly share code, notes, and snippets.

@bymathias
Last active August 29, 2015 14:22
Show Gist options
  • Save bymathias/246d16736e0c2f68d573 to your computer and use it in GitHub Desktop.
Save bymathias/246d16736e0c2f68d573 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
{ # this ensures the entire script is downloaded #
notice() { echo -e "\033[4;37m$@\033[0m"; }
# Requirements
notice "Requirements"
NODE=`which node 2>&1`
if [ $? -ne 0 ]; then
echo "Please install NodeJS."
exit 1
else
echo "NodeJS OK"
fi
NPM=`which npm 2>&1`
if [ $? -ne 0 ]; then
echo "Please install NPM."
else
echo "NPM OK"
fi
BOWER=`which bower 2>&1`
if [ $? -ne 0 ]; then
notice "Installing Bower globally..."
npm install -g bower
else
echo "Bower OK"
fi
GULP=`which gulp 2>&1`
if [ $? -ne 0 ]; then
notice "Installing Gulp globally..."
npm install -g gulp
else
echo "Gulp OK"
fi
# Get the repository
read -p "\nProject Name: " P_NAME
GIT=`which git 2>&1`
if [ $? -ne 0 ]; then
notice "\nGet repository using Curl..."
[[ ! -d $P_NAME ]] && mkdir $P_NAME
cd $P_NAME
curl -#L https://github.com/bymathias/base/tarball/master | tar -xzv --strip-components 1
else
notice "\nGet repository using Git..."
git clone https://bymathias@github.com/bymathias/_base.git $P_NAME
cd $P_NAME
fi
# Install dependencies
notice "Installing required npm packages..."
npm install
notice "Installing required bower packages..."
bower install
echo "\nInstall successfull\n"
} # this ensures the entire script is downloaded #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment