Last active
August 29, 2015 14:22
-
-
Save bymathias/246d16736e0c2f68d573 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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://[email protected]/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