![]() Save your changes ( File > Save) and close the Bundle editor window. Key Equivalent to option + command + shift + s.There we can assign a shortcut key for this command as well as modify some other behaviors of our command. The right pane of the Edit Bundle window contains the properties of our command. Now we need a way to trigger this from inside in the project window. We're all done with the code that performs the packaging of our project. system ( "zip -rq9 " + projName + ".zip " + projName + " -i " + include ) system ( "zip -rq9 " + projName + ".zip " + projName + " -x " + exclude ) # Format file exclude / includes for the command line TextMate exposes some essential properties to us which are accessible with Python's os library: For example, if you are using CodeKit in your project, you may want to exclude CodeKit's settings files codekit-config.json and config.rbīefore we can archive any of the project files, we first need to know where our TextMate project is located. You can extend these arrays to tailor it to your own needs. On the other hand, the includedFiles array forces the inclusion of English (US) only language files. We've included language files here since while testing your project, you might have created multiple language files that you don't want to be included in your final package. The excludedFiles array specifies not to include hidden files, Photoshop assets, and language files from our package. With your Bundle selected, head again to the menu bar, then create a new file ( File > New) but this time select Command:Ĭhange the name of your "untitled" command into something more descriptive like "Package WP Project".ĮxcludedFiles = ![]() With the Bundle window open and currently in your view, create a new file from the menu bar ( File > New) then select to create a new Bundle:īy default your Bundle is going to be named "YourUserName's Bundle", you can change that on the right pane of the Edit Bundle window. ![]() A window should pop up with that looks like this: Open the Bundle editor from TextMate's menu bar ( Bundles > Edit Bundles.). trigger this with the shortcut key option + command + shift + s.specify which files should always be included, and.specify which files should not be included,.package our whole project in a zip file,.For the purposes of this article, I will be using Python for coding the Bundle.īefore we start coding, first we need to finalize what we want our bundle to do. Some languages natively available to Macs are Bash, Perl, Ruby and Python. One good thing about TextMate Bundles is that you can use any programming language that's locally available to your system. In the same manner, TextMate Bundles provide additional functionality to TextMate, such as colorizing parts your code for a better coding experience, or performing a certain process when a shortcut key is pressed. WordPress plugins provide additional functionality to the WordPress core. You can find more information on TextMate from MacroMate's websiteīundles in TextMate are like plugins in WordPress. This article teaches about some tips regarding TextMate, an awesome code editor for Macs. This article will teach you on how to automate this packaging process by building a TextMate Bundle that would do everything for us with a single shortcut key. You'd then archive your project then perhaps use a third party app to remove the hidden files. Normally, this just means that you duplicate your files, then scan each and every directory deleting all the unwanted files. You would eventually need to clean your codebase up before zipping them all up for your users. Then when you're finally ready to ship your WordPress project, you'll end up having a web of multiple file types like *.php, *.css, *.scss, *.js, *.min.js, *.png and *.psd, maybe you'll have some hidden files like. After a while you'll be including other third-party PHP libraries as well. Then you find yourself creating image assets and adding them to your codebase together with their Photoshop file counterparts. You start off with just a few PHP, JavaScript and CSS files. If you've developed a WordPress theme or plugin, then you know how fast your codebase can grow in just a short amount of time.
0 Comments
Leave a Reply. |