emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] [babel] After Tangle Change File Permission


From: Rainer M Krug
Subject: Re: [Orgmode] [babel] After Tangle Change File Permission
Date: Wed, 09 Feb 2011 10:57:17 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15pre) Gecko/20110207 Lightning/1.0b2 Shredder/3.1.9pre

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/09/2011 10:16 AM, Ian Barton wrote:
> I am starting to use babel to maintain my collection of shell scripts. I
> want to automate the process as much as possible, so I would like to be
> able to set the execute bit on my tangled .sh scripts after the tangle
> process.
> 
> I see that there is an after-tangle hook. Can anyone give me some hints
> as to how I might use this to execute a chmod *.sh on the directory
> containing my tangles shell scripts.

Below an example how I use this:
1) I create a postTangleScript.sh, which I want to execute after
tangling. In this script, I put all the things I want to do.
2) I set the post-tangle-hook, so that the script is executed.
3) if you want to have the name of the tangled file automatically in
your post tangle script, you can use variables (but don't ask me how to
get the name of the tangled file)

Hope this helps,

Rainer


* Internal configurations
:noexport:
** Post tangle script
#+begin_src sh :tangle postTangleScript.sh :var
BUFFERFILENAME=(buffer-file-name)
  # do whatever
#+end_src

** Evaluate to run post tangle script
#+begin_src emacs-lisp :results silent :tangle no :exports none
  (add-hook 'org-babel-post-tangle-hook
            (
             lambda ()
                    (call-process-shell-command "./postTangleScript.sh"
nil 0 nil)
                    )
            )
#+end_src

> 
> Ian.
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode


- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Tel:        +33 - (0)9 53 10 27 44
Cell:       +27 - (0)8 39 47 90 42
Fax (SA):   +27 - (0)8 65 16 27 82
Fax (D) :   +49 - (0)3 21 21 25 22 44
Fax (FR):   +33 - (0)9 58 10 27 44
email:      address@hidden

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1SZP0ACgkQoYgNqgF2egogZACeK/GohKqClBenIaVsvqSboC/f
bX4AnA8+lCDUON76x7hFVAGTbmJv9zIA
=WgSG
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]