From 1bf3826f54d8c35797a739d8e37b1f9594e0b17a Mon Sep 17 00:00:00 2001 From: Reid 'arrdem' McKenzie Date: Wed, 5 Jul 2023 12:26:16 -0600 Subject: [PATCH] Fix: tolerate #! prefixed shebangs --- zapp/compiler/__main__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zapp/compiler/__main__.py b/zapp/compiler/__main__.py index d563b4a..facd434 100644 --- a/zapp/compiler/__main__.py +++ b/zapp/compiler/__main__.py @@ -343,7 +343,11 @@ def main(): ) with open(opts.output, "w") as zapp: - shebang = "#!" + manifest["shebang"] + "\n" + shebang = manifest["shebang"] + if not shebang.endswith("\n"): + shebang = shebang + "\n" + if not shebang.startswith("#!"): + shebang = "#!" + shebang zapp.write(shebang) # Now we're gonna build the zapp from the manifest