I want to make it so I can just type script/generate controller and it will run script/generate rspec_controller. How can I do this?
views:
60answers:
1
A:
Do you mean that you want it:
- to also run
script/generate rspec_controller, or - to only run
script/generate rspec_controller?
If 1 then you have multiple options. The simplest and less intrusive would probably be to simply wrap script/generate as follows:
- rename
script/generateasscript/generate.orig create
script/generateanew with the following contents:#!/bin/sh "`dirname \"$0\"`/generate.orig" "$@" if [ "$1" == "controller" ] ; then shift "`dirname \"$0\"`/generate.orig" rspec_controller "$@" fiensure the new
script/generateis executable etc., e.g.chmod a+rx script/generate- add
script/generate.origto source control and checkin the modifiedscript/generatescript
Cheers, V.
vladr
2010-04-10 09:23:42