Skip to content
Snippets Groups Projects
Commit 452975ad authored by Joe Garcia's avatar Joe Garcia
Browse files

tolerate encoding line after shebang

parent 8c1f841c
Branches
No related tags found
No related merge requests found
......@@ -55,9 +55,13 @@ def isRelScript(filepath):
return getLine(filepath,linenumber=1)=='#!/usr/bin/env re-l'
def extractRelInterpreter(filepath):
l=getLine(filepath,linenumber=2)
assert(l.startswith('#:'))
return l.split(':',1)[1].strip()
if not isRelScript(filepath):
raise RuntimeError("Not a re-l script!")
for line in range(2,5):
l=getLine(filepath,linenumber=line)
if l.startswith(('#re-l:','#:')):
return l.split(':',1)[1].strip()
raise RuntimeError("Couldn't find re-lative interpreter line (starts with '#re-l:')")
def relexec(interpreter,scriptfile,*_args):
args=[None,None]+list(_args)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment