Closed blikjeham closed 2 years ago
This is related to https://github.com/dflook/python-minifier/pull/8, but I don't see any progress in that pull request for a year and a half. I had to do the following workaround to retain the shebang:
pyminify script.py > script.py.min
echo "#!/usr/bin/python" > script.py
cat script.py.min >> script.py
2.6.0 has been released which preserves the shebang by default.
Some code requires a shebang (#!) to be present at the beginning of the file to instruct the program loader which python interpreter to use (e.g. "#!/usr/bin/python"). Since the shebang starts with a #, it is seen as a comment by python-minifier, and gets stripped from the minified code.
Could you add an exception to the minifier to leave the #! at the very beginning of the file alone?