Closed nagolove closed 8 months ago
You can use
#!/usr/bin/env -S tl run
as your shebang line and keep the script code in Teal. Does that solve your problem?
I'm a bit torn about automatically preserving the shebang line upon compilation because if a Teal script contains a hashbang pointing to tl
as indicated above, compiling it to Lua would render the shebang incorrect (and it's not feasible to automatically guess what the correct Lua incantation should be). Maybe the right answer would be to just cop out and add a compiler flag...
maybe check if the shebang contains lua
(or perhaps do it the other way and check if it doesn't include tl
) and preserve it if it does. Then you can also emit a warning if it contains tl
instead?
It won't be perfect (not by a long shot) but might be correct for enough cases to be worth it?
Thanks all contributors for satisfying feature request!
Hello! I use some Lua files as system scripts with executable bits and shebang at first line.
But tl compiler remove this first line. Could this behavior be fixed to leave this line alone in generated file?