Reputation: 41221
I am currently writing a CGI script that I store in a subversion tree built on a remote machine. There are a bunch of other related files on the subversion tree, but only a few CGI scripts. I currently edit the script with TRAMP and then have to manually cp
it to the cgi-bin
directory when it's ready for testing (which includes opening the CGI link in a browser).
How can I best automate this process? I'm half considering a small Makefile that can be kicked off by Emacs. I'm also considering an Emacs macro since Emacs is running locally it could probably actually open a new Firefox tab for me after pushing the file.
Upvotes: 1
Views: 162
Reputation: 524
I am using execute-buffer-script to execute scripts residing at the other end of a tramp connection in emacs. This does not work with cgi scripts, as they may need the extra information that the browser/webserver combination provides.
You could softlink your svn controlled cgi-bin to the location the web server expects or simply softlink each individual file.
cd /path/to/webservers/cgi-bin
ln -s /path/to/svn/controlled/cgi-bin/individual-file.ext individual-file.ext
Then point your tramp connection to either the file or the link and start modifying. Reload in the browser when you feel you have something that works, rinse, repeat. With most cgi programming (jsp included) this gives a very fast and interactive development process.
Upvotes: 1
Reputation: 10533
For development, you should edit your cgi script directly in the cgi-bin directory. Keep your firefox opened on the url of your script, then do C-r to reload the page.
Upvotes: 0