Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring where to download binaries from #41

Open
mbark opened this issue Nov 8, 2019 · 3 comments
Open

Allow configuring where to download binaries from #41

mbark opened this issue Nov 8, 2019 · 3 comments

Comments

@mbark
Copy link

mbark commented Nov 8, 2019

We would like to cache the binaries downloaded via binwrap via a repo in Artifactory. However, to do that we need to configure where to download the binaries from.

It would be preferable to have something similar to node-sass allowing you to configure the url to fetch the binary from.

If this is something that is interesting I could create a PR with this.

@avh4
Copy link
Owner

avh4 commented Nov 15, 2019

The index.js that your package provides is evaluated everytime the URLs are needed, so you should be able to do this already by putting whatever logic (or uses of process.env) you want in your index.js when you specify the urls that are passed to your call to binwrap.

Can you see if that works for your usecase?

@mbark
Copy link
Author

mbark commented Nov 18, 2019

Sorry, I see now that I wasn't quite clear on what I wanted.

The problem for us is external dependencies that download binaries; so in their case I can't modify the index.js. The feature that would be helpful for us is if binwrap provided a way for me -- as a user of a library that uses binwrap -- to provide a custom url to download from.

To clarify what I mean, an example of how it could look would be that library authors using binwrap would provide baseUrl, path and version in the configuration. Then I, as a user of the library, could provide an environment variable which would override the basePath configuration.

var binwrap = require("binwrap");
var path = require("path");

var packageInfo = require(path.join(__dirname, "package.json"));

module.exports = binwrap({
  dirname: __dirname,
  binaries: [
    "myapp-cli"
  ],
  baseUrl: "https://dl.bintray.com",
  path: "/me/myApp/",
  version: packageInfo.version
  urls: {
    "darwin-x64": "/mac-x64.tgz",
    "linux-x64": "/linux-x64.tgz",
    "win32-x64": "/win-i386.zip",
    "win32-ia32": "/win-i386.zip"
  }
});

@hauntedhill
Copy link

I have the same problem as mbark. Is a solution available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants