This is a simple plugin for Sublime Text 2 to trigger a build on each save.
Not all projects might need this plugin, especially if the build operation is lengthy. However, if you have a build that does things like pre-processing CSS via tools like LessCSS and stitching all JS files together, this might be very handy.
Clone this repo into your Sublime Text 2 Packages directory ###Linux cd ~/.config/sublime-text-2/Packages/ git clone git://github.com/alexnj/SublimeOnSaveBuild.git
###Mac cd ~/"Library/Application Support/Sublime Text 2/Packages/" git clone git://github.com/alexnj/SublimeOnSaveBuild.git
- Make sure you have a build operation set up in Sublime and you are able to build on CTRL+B or CMD+B.
- Hit your favorite shortcut to Save.
I added the setting saveOnBuild
control if the build process should be triggered or not. It's simple:
-
Disable global saveOnBuild in your user settings:
{ "saveOnBuild": false }
-
Create a Project with a build system
-
Open the PROJECTNAME.sublime-project file
-
Activate the feature only for this project:
{ "settings": { "saveOnBuild": true } }
-
Thats it!
Good luck!