Do you ever fire up TextWrangler and open a pkginfo file used in munki to adjust or add a key but when you go to actually add that key you can’t remember the exact format of the syntax? Was it “update_for” or “update-for”? It kinda matters. Lucky for us there is a syntax highlighting feature in TextWrangler (and BBEdit) that allows for customization called Language Modules.
I’ve created a munki Language Module, available on github, that lets you breath a little easier in knowing your syntax typo is not the reason munki is looping…that’s something else you’ve done.
Using the Language Module is fairly easy. To install:
- Download and copy the munki_langauage_module.plist to ~/Library/Application Support/TextWrangler/Language Modules/
- Restart TextWrangler.
- Adjust keyword and predefined syntax highlighting colors in the TextWrangler preferences if you so choose.
This module sets TextWrangler to detect all files that end in .plist as munki pkgsinfo files.
If that is not desirable and you’d rather have standard XML highlighting, then remove the BBLMSuffixMap key from the plist or change the syntax highlight language when you open the file.
Inside TextWrangler you can manually choose the language syntax highlighting from the options at the bottom of the TextWrangler window. Choose “Munki Pkgsinfo” to apply the highlighting. That’s it!
Below is an example of the difference between a syntax highlighted file on the left and a plain text file on the right.