Adding a shell script to be executed with the 'mrt/meteor create' command in terminal

How can I run a shell script that is executed when I enter the 'mrt create' command in the terminal?

Upvotes: 0

Views: 171

Answers (1)

Great question Johann!

Alright, so to turn a shell script into something as convenient as a terminal command, all you need to do is create an alias for that script in your terminal's rc file. Further instructions as to how you can do that can be found here.

So all you need to do is list out the commands you want automated in the shell script, including the meteor/mrt commands, and pass the directory/project name with the special variable "$1" passes the first argument after your command into your script.

Here's the script I am currently using, which implements the folder structure from Discover Meteor and adds coffeescript and stylus-mixins There are probably some redundancies in commands. Let me know if you see anything that can be cleaned!

Upvotes: 1

Related Questions