SyncSettings icon indicating copy to clipboard operation
SyncSettings copied to clipboard

Add hooks support

Open mfuentesg opened this issue 6 years ago • 0 comments

The idea behind this feature is, add the ability to execute commands before/after some specific tasks on this plugin. i.e: after upgrade, before upload.

Constraints:

  • [ ] Must be configurable (maybe in Sync Settings.sublime-settings file)

Sync Settings.sublime-settings

{
    "hooks": {
        "before_upgrade": [
            {
                "command": "my_custom_command",
                "args": {
                    "foo": "bar"
                }
            }
        ]
    }
}
  • [ ] Must be written as sublime text plugins
import sublime
import sublime_plugin

class ExampleCommand(sublime_plugin.TextCommand):
	def run(self, edit):
		self.view.insert(edit, 0, "Hello, World!")

mfuentesg avatar Jan 13 '19 16:01 mfuentesg