Skip to content

Instantly share code, notes, and snippets.

@connor
Created September 15, 2011 05:53
Show Gist options
  • Save connor/1218637 to your computer and use it in GitHub Desktop.
Save connor/1218637 to your computer and use it in GitHub Desktop.
newSite command to make a new site from the terminal
## please note: this assumes you have a folder called _StartingSiteTemplate in ~/Documents.
## i have uploaded a zip of my _StartingSiteTemplate here: http://cl.ly/1u2W1K2Q192Z3C0r2J0x
## that file above is based off of paul irish's html5 boilerplate - highly recommended!
## NOTE: this is using textmate and LESScss, but those are easily configurable.
## NOTE: if rsync isn't working for you, note the file paths I'm using.
newSite(){
echo "Please name the directory: "
read SITE_NAME
echo "Creating $SITE_NAME... zomg!"
mkdir $SITE_NAME
cp -r ~/Documents/_StartingSiteTemplate/* $SITE_NAME
cd $SITE_NAME
echo "[y/n] Would you like to set up rsync, so you can deploy by simply typing 'rake'?"
read user_response
if [[ "$user_response" == "Y" || "$user_response" == "y" || "$user_response" == "yes" || "$user_response" == "YES" || "$user_response" == "Yes" ]];
then
echo "What's your ssh username? "
read ssh_username
echo "What's your ssh server? "
read ssh_server
echo "...and what's your URL?"
read ssh_url
perl -pi -e "s/SSH_USER/$ssh_username/" Rakefile
perl -pi -e "s/SSH_SERVER/$ssh_server/" Rakefile
perl -pi -e "s/SSH_URL/$ssh_url/" Rakefile
fi
cd js/
echo "What ender modules would you like? (ex: jeesh bean domReady underscore qwery etc...)"
read ender_modules
ender build $ender_modules
cd ../
echo "Almost done. Opening in TextMate."
mate .
echo "I'm feeling SASSY!"
sass --watch stylesheets/less/styles.scss:stylesheets/css/styles.css --style compressed
}
@connor
Copy link
Author

connor commented Sep 19, 2011

Awesome! Glad you like it - feel free to copy/modify it however you'd like. If you don't mind though, please link to your personal function you use with WP or Magento here, just so we can keep all of these things centralized?

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