1

Every time I make a new webpage, I do the following commands in the terminal.

touch index.html
mkdir stylesheets
mkdir javascripts
mkdir images
mkdir sass
open index.html -a sublime\ text

I wish to automate this. like I wish I could type

init newProject

and all the above commands would execute on its own.

Is it possible?

1

You can do it with various methods, here's the easiest one in my opinion:

Paste this line in your ~/.bash_profile

function initProject { touch index.html && mkdir stylesheets && mkdir javascripts && mkdir images && mkdir sass && open index.html -a sublime\ text; };

Save it and execute source ~/.bash_profile

Right now you can type initProject to get what you want.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .