Skip to content
This repository has been archived by the owner on Oct 26, 2020. It is now read-only.

Handle :noweb and :shebang #15

Open
adelin-b opened this issue Apr 30, 2020 · 1 comment
Open

Handle :noweb and :shebang #15

adelin-b opened this issue Apr 30, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@adelin-b
Copy link

Handling :noweb and :shebang

So a block with :noweb ref or a :shebang

   #+BEGIN_SRC sh   :noweb-ref sh-bashrc   :noweb-sep "\n"
      [ -r $HOME/.config/sh/xdg.sh ] && . $HOME/.config/sh/xdg.sh
      [ -r $HOME/.config/sh/env.sh ] && . $HOME/.config/sh/env.sh
    #+END_SRC

    #+BEGIN_SRC sh   :tangle sh/.bashrc       :shebang "#!/bin/bash\n"
      # Source installed interactive shell configurations:
      <<sh-bashrc>>
    #+END_SRC

will be tangled to

#!/bin/sh

# Source installed login shell configurations:
[ -r $HOME/.config/sh/xdg.sh ] && . $HOME/.config/sh/xdg.sh
[ -r $HOME/.config/sh/env.sh ] && . $HOME/.config/sh/env.sh

But the sync will be back and remove the <<sha-bashrc>> and even add a new shebang at ever synchronisation and end like this:

    #+BEGIN_SRC sh   :noweb-ref sh-bashrc   :noweb-sep "\n"
      [ -r $HOME/.config/sh/xdg.sh ] && . $HOME/.config/sh/xdg.sh
      [ -r $HOME/.config/sh/env.sh ] && . $HOME/.config/sh/env.sh
    #+END_SRC

    #+BEGIN_SRC sh   :tangle sh/.bashrc       :shebang "#!/bin/bash\n"
     #!/bin/sh

     #!/bin/sh
     
     # Source installed login shell configurations:
     [ -r $HOME/.config/sh/xdg.sh ] && . $HOME/.config/sh/xdg.sh
     [ -r $HOME/.config/sh/env.sh ] && . $HOME/.config/sh/env.sh
    #+END_SRC

Im pretty sure it wont be doable but its just to be exhaustive about what the org-tanglesync could support (In a dreamed version).

@adelin-b adelin-b changed the title Handle noweb Handle :noweb and :shebang Apr 30, 2020
@mtekman mtekman added the documentation Improvements or additions to documentation label Apr 30, 2020
@mtekman
Copy link
Owner

mtekman commented Apr 30, 2020

Good spot, and thanks for testing this.

I will likely not implement a fix since it's far beyond my capabilities to handle no-web stuff, but I will write up in the README the limitations of the project

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants