curl -T localfile destinationUrl
The Eclipse people run this from the command line, changing the filename and url by hand each time they move to a different file. I wrote a simple macro:
// macro to save and send a jsp file to a local Day instance
String filename = buffer.getPath();
// save the buffer and upload it to crx.
if (!buffer.isReadOnly()) {
buffer.save(view, null);
}
//String filepath = filename.substring(filename.indexOf("WebContent") +"WebContent".length());
String filepath = filename.substring(filename.indexOf("jcr_root") + "jcr_root".length());
String destination = "http://admin:admin@localhost:4502" + filepath;
String cmd = "curl -T " + filename + " " + destination;
exec(cmd);
Then I mapped a keyboard shortcut to Alt+S. Now whenever I want to save an edited jsp to the server, it is a simple keyboard command, no typing long paths in the command line. The Eclipse guys are somewhat jealous and I am saving quite a bit of time.
No comments:
Post a Comment