Last active
December 14, 2015 07:09
-
-
Save benjamincharity/5048358 to your computer and use it in GitHub Desktop.
Script for AlfredApp to create a new project. Pulls in my boilerplate, curls latest scripts, sets up rvm, sets up git, create initial commit, add the remote repo and fix auth issue.
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
# @Auth Benjamin Charity - [email protected] | |
# | |
# Add this script to AlfredApp. | |
# If you set the trigger word to 'create' then you would | |
# open alfred and type 'create foobar'. When you hit enter | |
# this script will run and a new project will be created | |
# in the location specified. | |
# | |
# Then, on Github, create a repo with the exact same name | |
# that you typed in the initial command. The project will | |
# already be set up to push to this repo. | |
# | |
# Where so you want the project to be created? | |
cd ~/dropbox/freelance/projects/ | |
# Create a new folder using the name that was typed. | |
mkdir {query} | |
# Clone my boilerplate into this new directory. | |
# https://github.com/benjamincharity/project-boilerplate | |
git clone https://github.com/benjamincharity/project-boilerplate.git {query} | |
# Move into the project folder | |
cd {query} | |
# Create an rvmrc using the new project name | |
rvm --rvmrc --create 1.9.3@{query} | |
# Use the new gemset | |
rvm gemset use {query} | |
# Confirm the rvmrc | |
yes | |
# Run bundle | |
bundle | |
# Update jQuery | |
curl http://code.jquery.com/jquery.js > source/js/jquery.js | |
# Update Modernizr | |
curl http://modernizr.com/downloads/modernizr.js > source/js/modernizr.js | |
# Update Sugar [note: this link is not dynamic so it will need to be manually updated] | |
curl https://raw.github.com/andrewplummer/Sugar/master/release/sugar-full.development.js > source/js/sugar.js | |
# Update reset.scss | |
# https://github.com/benjamincharity/resets | |
curl https://raw.github.com/benjamincharity/resets/master/reset.scss > source/css/_reset.scss | |
# Initialize git | |
git init | |
# Remove the boilerplate remote repo | |
git remote rm origin | |
# Add the git repo | |
git remote add origin https://github.com/benjamincharity/{query}.git | |
# Fix github auth issues | |
# https://gist.github.com/benjamincharity/3420507 | |
git config remote.origin.url [email protected]:benjamincharity/{query}.git | |
# Make sure git is tracking all of the new files | |
git add . | |
# Make the initial commit | |
git commit -am "initial commit" | |
# Open the project with Macvim | |
# Textmate users should be able to substitute 'mate .' | |
mvim . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment