Closed PromisedJetpacks closed 7 years ago
Ah, good catch. However, phantomjs
isn't guaranteed to be in /usr/local/bin/
(even though it likely will be). Maybe we can check for both and then error out if we still can't find it:
from distutils.spawn import find_executable
# ...
cmd = find_executable('phantomjs') or find_executable('/usr/local/bin/phantomjs')
if not cmd:
logging.critical('Cannot find phantomjs. Make sure it is in your path')
return
script_output = check_output([cmd, '--ssl-protocol=any', '%s/ge-cancellation-checker.phantom.js' % pwd, '--config', settings.get('configfile')]).strip()
Ah, good point. I think what you recommended would definitely help anyone having path issues.
@PromisedJetpacks Fixed in mater
. Thanks!
Struggled for a while trying to get this to schedule properly. I could run the script fine manually through terminal but when crontab scheduling, it struggled to find phantomjs. Changing the launcher to use the full path '/usr/local/bin/phantomjs' instead of just 'phantomjs' fixed my issue. If you feel this was just my own local mac issue and don't think this commit is necessary, it might be worth at least adding some help documentation on trying to use 'usr/local/bin/phantomjs' instead of 'phantomjs' due to the amount of people attempting to use this that aren't tech-savvy.