A Bash Script for New projects

Posted 22nd August 2013

When­ever I start a new web project, the ini­tial steps are pretty much the same:

  • Cre­ate a new folder, in my case in /var/www
  • Change the own­er­ship of the new folder
  • Come up with a new host­name, e.g. myproject.local
  • Cre­ate an entry in etc/hosts
  • Cre­ate an Apache vir­tual host for it
  • Cre­ate a new database
  • Cre­ate a new Git repository
  • Intialise the Git repository
  • Cre­ate a new project in Sublime

Not par­tic­u­larly hard, but pretty repet­i­tive. And if something’s repet­i­tive, chances are it can be scripted!

So here’s what I came up with: