with open(ifile) as itmp:
tmp.write(itmp.read())
except Exception as e:
raise ValueError("Failed to read input file {}: {}".format(ifile, e))
elif isinstance(script, str) and script.strip():
input_file = tempfile.NamedTemporaryFile(mode="w+t", suffix=".md", delete=False).name
with open(input_file, "w") as tmp:
tmp.write(script)