SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
249 stars 73 forks source link

Remove --tag-prefix from install script to enable overwriting of binary_host #248

Closed skyd0me closed 2 years ago

skyd0me commented 2 years ago

Hi,

we are using the node-rfc lib for an internal application where we dont have access to the internet (as already discussed in: https://github.com/SAP/node-rfc/issues/125) But the manual work with overwriting the host entry and publishing the lib again manually is really time consuming. So I still try to find a better way to do that.

We already created two separate repos for that in artifactory (npm proxy + github download proxy).

Downloading the npm package is easy as we can set the --registry parameter to the internal artifactory. But downloading the binaries is a different story.

I saw that its possible to set the binary_host env variable of the prebuild-install lib to overwrite the host entry in your package.json to map it to our internal artifactory. npm config set node-rfc_binary_host https://artifactory...com/artifactory/github-remote/sap/node-rfc/releases/download

Unfortunately this will result in an download url like that: prebuild-install http request GET https://artifactory...com/artifactory/github-remote/sap/node-rfc/releases/download/true2.5.1/node-rfc-v2.5.1-napi-v6-linux-x64.tar.gz

Somehow the "v" tag gets replaced with "true".

If I manually remove the --tag-prefix from your install script, everything workes like expected as "v" is the default and gets not replaces by the "true" tag. "install": "prebuild-install -r napi || cmake-js rebuild",

I was not able so far to figure out where this "true" is coming from neither if there is a way to replace the tag-prefix via env variable.

Do you see any other way to solve this problem or maybe its possible to publish a version without the --tag-prefix parameter? Would really appreciate your help.

Kind Regards Markus

bsrdjan commented 2 years ago

Hi Markus,

sorry for the long response time. I tested too and the --tag-prefix seem not to be needed any more.

It will be removed in next release

Kind regards, Srdjan