How do I create a new command in a bundle? I am trying to follow these instructions and I do not understand how to create a new command. Can someone please explain how this is done?
https://coderwall.com/p/j7qqsa/minify-your-css-inside-of-textmate
In your Bundles menu, go to Edit Bundles and select your favorite CSS Bundle (I am personally a huge proponent of mCss <http://minimaldesign.net/downloads/tools/textmate-css-bundle> ). Add a new Command, and enter make the command contents the following code:
# Create the minified filename
NEWFILE=${TM_FILENAME%\.css}'.min.css'
# Minify into that file
curl -X POST -s --data-urlencode "input@${TM_FILENAME}" \
http://www.cssminifier.com/raw > $NEWFILE
# And open it
mate $NEWFILE
You can make your key equivalent anything you'd like, I set mine to Cmd + Shift + R. Once you have done this, give it a whirl. You should see that your styles.css generates a styles.min.css in the same directory, as well as opens it in Textmate.
To note: if you don't have the Textmate command line utility installed, simply delete the last line of this command to stop seeing errors.
_______________________________________________
textmate mailing list
textmate@lists.macromates.com
http://lists.macromates.com/listinfo/textmate