[TxMt] Command Help for templates

Ketan Anjaria fire at kidbombay.com
Mon Feb 14 18:53:06 UTC 2005


I have a variable "myPackage" in my template. I would like to replace 
that with the directory of the template.

For example if I created a file at 
/project/include/com/kidbombay/Myfile.as
I would like to replace all instances of myPackage in my template with 
"com.kidbombay"

Basically the steps are
1. Is the file located inside a "include" directory? If yes continue.
2. Parse all folders down from the include level. 
"include/com/client/project" would return "com/client/project"
3. Replace the slashes with dots. "com/client/project" becomes 
com.client.project.
4. Replaces all instances of myPackage in my template with 
"com.client.project"

How would I do this? I am not very familiar with perl.

Thanks!




More information about the textmate mailing list