Skip to content

Instantly share code, notes, and snippets.

@juaniyyoo
Last active February 5, 2016 20:53
Show Gist options
  • Save juaniyyoo/385fdff6a921ef8dfb7c to your computer and use it in GitHub Desktop.
Save juaniyyoo/385fdff6a921ef8dfb7c to your computer and use it in GitHub Desktop.
Node.js project initialization
# Initialization of a Node.js project with npm, .eslint, travis, grunt,
GITHUB_ACCOUNT=Picta-it
# Read github project name
echo -n "Enter your github project name : "
read PROJECT_NAME
# Display github link
echo "You must create your account repository first https://github.com/organizations/$GITHUB_ACCOUNT/repositories/new"
# Clone the github project
git clone git@github.com:$GITHUB_ACCOUNT/$PROJECT_NAME.git > /dev/null
if [ $? -eq 0 ]; then
echo "Repository $GITHUB_ACCOUNT/$PROJECT_NAME cloned."
fi
cd $PROJECT_NAME
# Get Node.js backend .eslint file
wget ".eslint gist URL" 2&>1 > /dev/null
echo "Code linter downloaded."
# Get Node.js backend Gulp file
wget "Gulp gist URL" 2&>1 > /dev/null
echo "Task runner downloaded."
# Get Node.js backend travis file
wget "Travis gist URL" 2&>1 > /dev/null
echo "Builder configuration template file downloaded."
# Get README template
wget "README template URL" 2&>1 > /dev/null
echo "README.md template file downloaded."
# Initialize package.json
npm init --yes 2&>1 > /dev/null
echo "Package file initialized."
# Create file structure
mkdir -p app/ test/unit/app
touch index.js app/.empty test/unit/index.js test/unit/app/.empty
echo "Folder structure created."
@juaniyyoo
Copy link
Author

Replace this with yeoman

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