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

Why are other architectures ignored? #211

@szglemdx

Description

@szglemdx

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'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions