Explorar o código

babel: tangled files which include shebang lines are now made executable

Eric Schulte %!s(int64=15) %!d(string=hai) anos
pai
achega
ceeb4681ef
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      contrib/babel/lisp/org-babel-tangle.el

+ 2 - 0
contrib/babel/lisp/org-babel-tangle.el

@@ -139,6 +139,8 @@ exported source code blocks by language."
 			  (goto-char (point-max))
 			  (insert content)
 			  (write-region nil nil file-name))))
+		    ;; if files contain she-bangs, then make the executable
+		    (when she-bang (set-file-modes file-name ?\755))
                     ;; update counter
                     (setq block-counter (+ 1 block-counter))
                     (add-to-list 'path-collector file-name)))))