Execute CURL when saving file


#1

Hi,

Is there any package, that allows me to execute a specific URL when saving any file in my Project.

Example: i press cmd + s -> curl(“http://example.com/refresh/”);

Kind regards

Litecoin


#2

That seems really application specific, so you should probably just add something in your init script:

atom.workspace.observeTextEditors (editor) ->
	editor.onDidSave ->
		{spawn} = require 'child_process'
		curl = spawn 'curl', ['www.google.com']
		curl.stdout.on 'data', (data) -> console.log data.toString().trim()

Confession: I stole the spawn code outright from this stack overflow post

Also see the atom documentation for this event subscription.