Last active
December 22, 2015 22:49
-
-
Save marcuslilja/6542899 to your computer and use it in GitHub Desktop.
Simple bash script to clone repository boilerplate repository and remove .git folder inside. Timesaver when creating new projects.
This file contains hidden or 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/sh | |
# Store the git repository url | |
REPOSITORY="[email protected]:marcuslilja/html5-boilerplate-grunt.git" | |
# Fetch all arguments | |
args=("$@") | |
# Count the number of arguments | |
number_of_arguments=${#args[@]} | |
# Check that number of arguments is not less than or equal to 0. If that | |
# is true, exit with status 1 | |
if [ ${number_of_arguments} -le "0" ] | |
then exit 1 | |
fi | |
# Set the first argument to be the project name | |
PROJECT_NAME=${args[0]} | |
# Clone the repository to project folder | |
git clone ${REPOSITORY} ${PROJECT_NAME} | |
# Enter the project folder | |
cd ${PROJECT_NAME} | |
# Remove git folder | |
rm -rf .git |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment