diff --git a/entangled/hooks/shebang.py b/entangled/hooks/shebang.py index 145f14b..2828cac 100644 --- a/entangled/hooks/shebang.py +++ b/entangled/hooks/shebang.py @@ -5,6 +5,11 @@ class Hook(HookBase): def on_read(self, code: CodeBlock): lines = code.source.splitlines() + if len(lines) == 0: + return + if lines[0].startswith("#!"): code.header = lines[0] code.source = "\n".join(lines[1:]) + + return