pallet / stevedore

A shell script embedding in clojure
93 stars 14 forks source link

Remove the need of `fragments` introduced by the source line number feature #23

Open tbatchelli opened 11 years ago

tbatchelli commented 11 years ago

The introduction of source line numbers in the generated script created a new issue, scripts are not composable outside of stevedore (e.g. https://github.com/pallet/pallet/blob/develop/src/pallet/crate/etc_hosts.clj#L115 where the file name is generated via stevedore).

The problem is that the way comments work in bash make this kind of composition impossible, as anything after the comment is ignored. Since now stevedore adds the line numbers as comments, we needed a way to generate scripts without these line numbers.

A better solution could be to have stevedore proactively sanitize these 'included' scripts by removing comments. This way, we could still regular stevedore scripts without needing the special case of 'fragments'

tbatchelli commented 11 years ago

some ideas: http://stackoverflow.com/questions/2524367/inline-comments-for-bash