Scriptify makes it extremely easy to go from text in buffer to runnable script.
M-x scriptify does the following:
- insert shebang in the beginning of the buffer (if it is not already there)
- chop off extension (if any) of file
- move file to special directory for scripts (optional)
- set executable bit on
If you use el-get, use this recipe:
(:name scriptify :type github :pkgname "vderyagin/scriptify")
M-x customize-group RET scriptify RET
scriptify-scripts-directoryvariable contains path to directory you want to put scripts in, presumably it should be in
PATHenviroment variable. Set
nilin order not to move files anywhere.
scriptify-shebang-alistvariable is an alist that contains mapping from major-mode symbols to shebang strings (or string-returning functions).