GitXplorerGitXplorer
l

ExecuteOnSave

public
7 stars
3 forks
2 issues

Commits

List of commits on branch master.
Verified
198bf74b814232af0c3f432a4f6399cce58a74de

Update README.md

committed 7 years ago
Unverified
416820d7a7cdac9144d05fd90e108b03f04cc229

add key binding support

committed 12 years ago
Unverified
56eccb042450666b4b563fe16a3d3b2ad940563e

update readme

committed 12 years ago
Unverified
f620f5b247844fb14861d5bc04cbaf4cd468092e

update readme

committed 12 years ago
Unverified
362d76a7fce70a162dd378a8f2751077232152da

first commit

committed 12 years ago

README

The README file for this repository.

ExecuteOnSave Sublime Text 2 Plugin

This simple plugin executes a command or multiple commands when a specific file is saved.
(Inspired by https://github.com/alexnj/SublimeOnSaveBuild)

Installation

Without Git: Download the latest source from GitHub and copy the ExecuteOnSave folder to your Sublime Text 2 "Packages" directory.

With Git: Clone the repository in your Sublime Text 2 "Packages" directory:

git clone git://github.com/luwes/ExecuteOnSave.git

The "Packages" directory is located at:

  • OS X:

      ~/Library/Application Support/Sublime Text 2/Packages/
    
  • Linux:

      ~/.config/sublime-text-2/Packages/
    
  • Windows:

      %APPDATA%/Sublime Text 2/Packages/
    

Configuration

There are a number of configuration options available to customize the behavior of ExecuteOnSave. For the latest information on what options are available, select the menu item Preferences->Package Settings->ExecuteOnSave->Settings - Default.

Do NOT edit the default ExecuteOnSave settings. Your changes will be lost when ExecuteOnSave is updated. ALWAYS edit the project ExecuteOnSave settings by selecting Project->Edit Project.

  • build_on_save Set to 1 to trigger a build on save. By default, this is set to 0.

  • filter_execute Is an array that holds one array or multiple arrays with a length of 2. The first element is a regular expression that specifies on which files that are saved the command should be executed. The second element is the command that should be executed. Okay this sounds way too complicated, an example should clear this up.

Example project file:

{
	"folders":
	[
		{
			"path": "/Users/username/Sites/projects/flow2/repo"
		}
	],
	"settings":
	{
		"build_on_save": 1,
		"filter_execute":[
			["\\.js$", "/Users/username/Sites/projects/flow2/repo/build.sh"],
			["\\.as$", "/Users/username/Sites/projects/flow2/repo/flash/build.sh"]
		]
	}
}

In this case javascript files that are saved trigger an execution of the ..repo/build.sh file and actionscript files that are saved trigger an execution of the ..repo/flash/build.sh.

It's also possible to execute the commands with a keyboard combo instead of on every save. This is handy for commands that take a lot of time. For example, I have this in my Preferences->Key Bindings - User.

[
	{ "keys": ["ctrl+z"], "command": "execute_on_save" }
]