Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The shebang is stripped from the minified python code #34

Closed
blikjeham opened this issue Sep 20, 2021 · 2 comments
Closed

The shebang is stripped from the minified python code #34

blikjeham opened this issue Sep 20, 2021 · 2 comments

Comments

@blikjeham
Copy link

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?

@blikjeham
Copy link
Author

This is related to #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

@dflook
Copy link
Owner

dflook commented Apr 10, 2022

2.6.0 has been released which preserves the shebang by default.

@dflook dflook closed this as completed Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants