Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Why are other architectures ignored? #211

Open
szglemdx opened this issue Mar 4, 2018 · 0 comments
Open

Why are other architectures ignored? #211

szglemdx opened this issue Mar 4, 2018 · 0 comments

Comments

@szglemdx
Copy link

szglemdx commented Mar 4, 2018

Your package depends on the phantomjs-prebuilt, which is capable of finding phantomjs binary on various systems, but for some reason you use its capabilities only for linux and darwin. #53 suggested to add freebsd to the list, but for some reason it's still not merged. Why? And why not add other architectures?

People using your package on BSDs or other OSes have to manually provide the path to phantomjs with PHANTOMJS_BIN, even though it could be found in PATH. But there is phantomjs-prebuilt in the dependencies, come on, let it do it's job!

You might explicitly add more architectures to the list or you could avoid white-listing and use code like the following:

var otherPlatformsHandler = {
  get: function(target, name) {
    if (target.hasOwnProperty(name)) {
      return target[name]
    }
    return require('phantomjs-prebuilt').path
  }
}

PhantomJSBrowser.prototype = {
  name: 'PhantomJS',

  DEFAULT_CMD: new Proxy({ win32: phantomJSExePath() }, otherPlatformsHandler),
  ENV_CMD: 'PHANTOMJS_BIN'
}
@szglemdx szglemdx changed the title Why other architectures are not supported? Why are other architectures ignored? Mar 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant