-
Notifications
You must be signed in to change notification settings - Fork 401
Fix for cross-platform installation issues (macOS/Linux) #28
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| #!/bin/bash | ||
| sed "1s|.*|#!$(which python2)|" gopherus.py > tmp && mv tmp gopherus.py | ||
| python2 -m pip install argparse | ||
| python2 -m pip install requests | ||
|
Comment on lines
3
to
4
|
||
| chmod +x gopherus.py | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shebang rewrite can silently produce an invalid
#!line whenpython2is not on PATH (common on macOS where it may bepython2.7or not installed). It also relies onwhich(not POSIX) and uses a fixed temporary filename (tmp) that can collide with an existing file or be clobbered on reruns. Consider: (1) resolve the interpreter withcommand -vand fail fast with a clear error if not found (before modifyinggopherus.py), optionally trying common fallbacks likepython2.7; (2) usemktemp(and a trap/cleanup) for the temporary file; and (3) quote paths/variables to handle spaces safely.