Shell commands in org files
I'VE BEGUN experimenting with adding shell commends into org files as org-babel blocks. This allows me to record my common actions and 1. explain what they do, 2. make them quickly repeatable from within emacs. To start with I've just added the command to run my Jekyll server locally into a file, i.e.
Kill the blog by killing the buffer *Jekyll blog* #+header: :dir "./jekyll/" #+begin_src elisp :results silent (start-process "Jekyll blog" "*Jekyll blog*" "jekyll" "serve")
Now, when opening my blog generate file, the blog can be run with a simple C-c C-c on the above block. I'm going to have a go at generating a "repository jumping" script with this technique - at work I have a little powershell script that provides a bunch of shortcuts to different repositories - calling "repo [repo]" will CD into that repository's directory. Could be cool to generate that file using some tangling and a templating tool.
Useful links |
Literate devops |