wch / webshot

Take screenshots of web pages from R
http://wch.github.io/webshot/
227 stars 40 forks source link

Improved install phantomjs #82

Closed coatless closed 5 years ago

coatless commented 5 years ago

This PR implements the PhantomJS installation check as described in #25 by:

  1. Adding an is_phantomjs_installed() function that returns TRUE/FALSE if PhantomJS is installed or not.
  2. Modifying the parameter of install_phantomjs() to include force, which controls whether PhantomJS will be installed or not if it already is present on the user's computer.
coatless commented 5 years ago

@wch thanks. I'll add in a version check.

coatless commented 5 years ago

@wch I've added in the version check. To do so, I've created three internal functions:

  1. phantomjs_cmd_result()
    • Passes its arguments to the phantom_run() function.
    • Captures and stores phantom_run()'s STDOUT information instead of only displaying it on console.
  2. phantomjs_version()
    • Retrieves the phantomjs version via path/to/bin/phantom --version obtained under phantomjs_cmd_result()
  3. is_phantomjs_version_latest()
    • Compares the installed version with requested version and determines if it is out of date.
coatless commented 5 years ago

@wch ready for round 3.

coatless commented 5 years ago

@wch let's try round 4?

wch commented 5 years ago

Thanks!