Created
November 2, 2015 16:24
-
-
Save dakrone/432e60e937afbe3ea3dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# -*- mode: shell-script -*- | |
# | |
# Tangle .org files with org-mode | |
# Example usage: | |
# ∴ tangle nested-in-all.org | |
# Files: "nested-in-all.org", Dir: /Users/hinmanm/es-scripts | |
# Tangled 6 code blocks from nested-in-all.org | |
# Set this to the location of your emacs executable | |
EMACSCMD="emacs" | |
# wrap each argument in the code required to call tangle on it | |
DIR=`pwd` | |
FILES="" | |
for i in $@; do | |
echo "File: $i" | |
$EMACSCMD -nw --batch --eval " | |
(progn | |
(require 'org-install) | |
(find-file (expand-file-name \"$i\" \"$DIR\")) | |
(org-babel-tangle) | |
(kill-buffer))" 2>&1 | grep "Tangled" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment