detangle.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/usr/bin/zsh
  2. # Copyright FlintFam Systems Management, 2013.
  3. #
  4. # This program is free software: you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation, either version 3 of the License, or
  7. # (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. DIR=`pwd`
  17. FILES=""
  18. for i in $@; do
  19. FILES="$FILES \"$i\""
  20. done
  21. ORGBASEDIR=''
  22. ORGLDIR="${ORGBASEDIR}/lisp/"
  23. ORGCONTRIB="${ORGBASEDIR}/contrib/"
  24. emacs -Q --batch \
  25. --eval "(progn
  26. (add-to-list 'load-path (expand-file-name \"$ORGLDIR\"))
  27. (add-to-list 'load-path (expand-file-name \"$ORGCONTRIB\" t))
  28. (require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle)
  29. (mapc (lambda (file)
  30. (find-file (expand-file-name file \"$DIR\"))
  31. (org-babel-tangle)
  32. (kill-buffer)) '($FILES)))" 2>&1 |grep tangled