I have a bash script which is supposed to call a Python script stored on GitHub and run it with arguments:
#!/bin/bash +x
wget https://github.place.otherplace.com/myrepo/repo_folder/blob/Python/pythonScript.py
chmod +x pythonScript.py
python pythonScript.py
I'm getting the following response: HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘DisputeSystem.py’
0K .......... .......... .......... ........ 795K=0.05s
2016-06-14 11:08:24 (795 KB/s) - ‘pythonScript.py’ saved [39657]
File "pythonScript.py", line 4
<!DOCTYPE html>
^
SyntaxError: invalid syntax
Build step 'Execute shell' marked build as failure
[BFA] Scanning build for known causes...
[BFA] No failure causes found
[BFA] Done. 0s
Finished: FAILURE
I figure it has something to do with wget pulling the HTML headers as well, but I haven't been able to figure out a way to strip them. Any help is appreciated.
You're not downloading the script. You're downloading a GitHub web page with the script and a whole bunch of other stuff on it, like GitHub navigation and a search bar and clickable line numbers.
Go to that page in your web browser, and you should see a "Raw" link. Click on that, and the resulting page is what you should be wgetting.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With