Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: prebuild/prebuild-install
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: db6ebe7d1a1d0f12cbc5bef54cc3d105c56a7946
Choose a base ref
...
head repository: prebuild/prebuild-install
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8250adf958fcec6fb3ddfcd7dd5ceb0e0e29e419
Choose a head ref

Commits on Oct 22, 2020

  1. Copy the full SHA
    e5c9a5a View commit details

Commits on Oct 23, 2020

  1. Copy the full SHA
    6efc965 View commit details
  2. Copy the full SHA
    a2f6fb4 View commit details
  3. Copy the full SHA
    8acccac View commit details
  4. Remove use of env.npm_config_argv for npm 7

    Instead use npm_config_* which works as far back as npm > 0.1.7.
    It translates command line flags to environment variables, where:
    
    --foo becomes npm_config_foo='true'
    --no-foo becomes npm_config_foo=''
    --foo=false becomes npm_config_foo=''
    vweevers committed Oct 23, 2020
    Copy the full SHA
    22175b8 View commit details
  5. Copy the full SHA
    08eaf6d View commit details
  6. Breaking: don't skip downloads in standalone mode

    I.e. when running `npm install` in the working directory of a
    project that uses prebuild-install, you must now run a more
    explicit `npm install --build-from-source`.
    
    This is necessary to support npm 7, where we do not have enough
    information to automatically determine it and would erroneously
    skip downloads on normal installs.
    vweevers committed Oct 23, 2020
    Copy the full SHA
    b6f3b36 View commit details
  7. Breaking: remove --compile and --prebuild options (#131)

    In favor of --build-from-source which is a common option among
    build tools (node-gyp-build, node-pre-gyp). The --compile option
    was an alias and --prebuild is the default behavior anyway.
    vweevers authored Oct 23, 2020
    Copy the full SHA
    94f2492 View commit details
  8. Prepare 6.0.0

    vweevers committed Oct 23, 2020
    Copy the full SHA
    36d40ca View commit details
  9. 6.0.0

    vweevers committed Oct 23, 2020
    Copy the full SHA
    9e62565 View commit details

Commits on Feb 13, 2021

  1. fixes empty --tag-prefix

    mathiask88 committed Feb 13, 2021
    Copy the full SHA
    289f0de View commit details

Commits on Feb 14, 2021

  1. Merge pull request #143 from prebuild/fix-empty-tag-prefix

    fixes empty --tag-prefix
    Lars-Magnus Skog authored Feb 14, 2021
    Copy the full SHA
    998bce3 View commit details
  2. Prepare 6.0.1

    Lars-Magnus Skog committed Feb 14, 2021
    Copy the full SHA
    0069d33 View commit details
  3. 6.0.1

    Lars-Magnus Skog committed Feb 14, 2021
    Copy the full SHA
    43d581a View commit details

Commits on Apr 3, 2021

  1. Restore local prebuilds feature (#137)

    Previously removed in #81 / a069253.
    jchook authored Apr 3, 2021
    Copy the full SHA
    dc4e5ea View commit details
  2. 6.1.0

    vweevers committed Apr 3, 2021
    Copy the full SHA
    f6d0cee View commit details

Commits on Apr 4, 2021

  1. Copy the full SHA
    8cb1ced View commit details
  2. Copy the full SHA
    2950fb2 View commit details
  3. 6.1.1

    vweevers committed Apr 4, 2021
    Copy the full SHA
    2e3fedb View commit details

Commits on Apr 23, 2021

  1. Copy the full SHA
    ff6429e View commit details
  2. Cleanup workflow

    vweevers committed Apr 23, 2021
    Copy the full SHA
    b772a42 View commit details

Commits on Apr 24, 2021

  1. Copy the full SHA
    db36c7a View commit details
  2. 6.1.2

    vweevers committed Apr 24, 2021
    Copy the full SHA
    97ff071 View commit details

Commits on May 17, 2021

  1. Copy the full SHA
    5ee1a2f View commit details

Commits on Jun 3, 2021

  1. Copy the full SHA
    e08d75a View commit details
  2. 6.1.3

    Lars-Magnus Skog committed Jun 3, 2021
    Copy the full SHA
    cca87fb View commit details

Commits on Aug 11, 2021

  1. Make 'rc.path' absolute (#158)

    Closes #157.
    dunkmann00 authored Aug 11, 2021
    Copy the full SHA
    57bcc06 View commit details
  2. Copy the full SHA
    a964e5b View commit details
  3. Move auth token to header instead of query param (#160)

    Github will deprecate auth via query param, so we move this to http
    header. Closes #121.
    nicolai-nordic authored Aug 11, 2021
    Copy the full SHA
    b3fad76 View commit details
  4. 6.1.4

    vweevers committed Aug 11, 2021
    Copy the full SHA
    c96c526 View commit details

Commits on Nov 12, 2021

  1. Breaking: bump node-abi so that Electron 14+ gets correct ABI (#161)

    electron/node-abi#113 was fixed in 3.3.0
    and is affecting Electron 14+.
    
    With the current node-abi prebuild-install will download ABI 89 for
    electron 14 and 15 and then modules will fail to load as electron 14
    has ABI 97 and electon 15 has ABI 98 in reality.
    
    Drops support of Node.js < 10.
    csett86 authored Nov 12, 2021
    Copy the full SHA
    477f347 View commit details
  2. Bump standard devDependency

    vweevers committed Nov 12, 2021
    Copy the full SHA
    734ae27 View commit details
  3. Bump tape devDependency

    vweevers committed Nov 12, 2021
    Copy the full SHA
    1d53607 View commit details
  4. Bump simple-get

    vweevers committed Nov 12, 2021
    Copy the full SHA
    7468c14 View commit details
  5. Update badges in README

    vweevers committed Nov 12, 2021
    Copy the full SHA
    ff4a4d8 View commit details
  6. Add release workflow

    vweevers committed Nov 12, 2021
    Copy the full SHA
    8ebc076 View commit details
  7. 7.0.0

    vweevers committed Nov 12, 2021
    Copy the full SHA
    542788b View commit details

Commits on Nov 18, 2021

  1. Bump hallmark devDependency

    vweevers committed Nov 18, 2021
    Copy the full SHA
    d8a8c0e View commit details

Commits on Nov 27, 2021

  1. Clarify usage in README

    Closes #133, closes #134.
    vweevers committed Nov 27, 2021
    Copy the full SHA
    8ee70f9 View commit details

Commits on Jan 28, 2022

  1. Upgrade to the latest version of detect-libc (#166)

    Uses the Report API where available (Node.js 12+)
    Otherwise spawns a single child process (Node.js 8, 10)
    lovell authored Jan 28, 2022
    Copy the full SHA
    f71c6b9 View commit details
  2. 7.0.1

    vweevers committed Jan 28, 2022
    Copy the full SHA
    4a1ed43 View commit details

Commits on Apr 20, 2022

  1. Allow setting libc to glibc on non-glibc platform (#176)

    Discard libc value on non-linux platforms
    joonamo authored Apr 20, 2022
    Copy the full SHA
    f729abb View commit details
  2. 7.1.0

    lovell committed Apr 20, 2022
    Copy the full SHA
    5065bce View commit details

Commits on May 30, 2022

  1. Ensure script output can be captured by tests (#181)

    Replaces temporary logfile workaround
    lovell authored May 30, 2022
    Copy the full SHA
    d1853cb View commit details

Commits on Jun 7, 2022

  1. Replace use of npmlog dependency with console.error (#182)

    No change to log message format or level
    lovell authored Jun 7, 2022
    Copy the full SHA
    4e2284c View commit details
  2. 7.1.1

    lovell committed Jun 7, 2022
    Copy the full SHA
    8250adf View commit details
Showing with 899 additions and 434 deletions.
  1. +17 −0 .github/workflows/release.yml
  2. +29 −0 .github/workflows/test.yml
  3. +1 −0 .npmignore
  4. +0 −12 .travis.yml
  5. +110 −1 CHANGELOG.md
  6. +68 −13 README.md
  7. +0 −40 appveyor.yml
  8. +10 −14 asset.js
  9. +16 −23 bin.js
  10. +75 −63 download.js
  11. +2 −0 help.txt
  12. +27 −7 log.js
  13. +11 −14 package.json
  14. +10 −13 proxy.js
  15. +24 −41 rc.js
  16. +29 −30 test/asset-test.js
  17. +84 −46 test/download-test.js
  18. +5 −5 test/log-test.js
  19. +7 −7 test/proxy-test.js
  20. +102 −49 test/rc-test.js
  21. +114 −0 test/skip-test.js
  22. +85 −43 test/util-test.js
  23. +14 −0 test/util/clean-env.js
  24. +59 −13 util.js
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Release
on:
push:
tags: ['*']
permissions:
contents: write
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Create GitHub release
uses: docker://antonyurchenko/git-release:v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test
on: [push, pull_request]
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [10, 12, 14, 16]
arch: [x64]
include:
- os: windows-latest
node: 14
arch: x86
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Node ${{ matrix.node }} ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use node ${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
architecture: ${{ matrix.arch }}
- name: Install
run: npm install
- name: Test
run: npm test
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
npm-debug.log
test
.github
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

111 changes: 110 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,116 @@
# Changelog

## 5.3.6 - 2020-10-20
## [7.1.1] - 2022-06-07

### Changed

- Replace use of npmlog dependency with console.error ([#182](https://github.com/prebuild/prebuild-install/issues/182)) ([`4e2284c`](https://github.com/prebuild/prebuild-install/commit/4e2284c)) (Lovell Fuller).

- Ensure script output can be captured by tests ([#181](https://github.com/prebuild/prebuild-install/issues/181)) ([`d1853cb`](https://github.com/prebuild/prebuild-install/commit/d1853cb)) (Lovell Fuller).

## [7.1.0] - 2022-04-20

### Changed

- Allow setting libc to glibc on non-glibc platform ([#176](https://github.com/prebuild/prebuild-install/issues/176)) ([`f729abb`](https://github.com/prebuild/prebuild-install/commit/f729abb)) (Joona Heinikoski).

## [7.0.1] - 2022-01-28

### Changed

- Upgrade to the latest version of `detect-libc` ([#166](https://github.com/prebuild/prebuild-install/issues/166)) ([`f71c6b9`](https://github.com/prebuild/prebuild-install/commit/f71c6b9)) (Lovell Fuller).

## [7.0.0] - 2021-11-12

### Changed

- **Breaking:** bump `node-abi` so that Electron 14+ gets correct ABI ([#161](https://github.com/prebuild/prebuild-install/issues/161)) ([`477f347`](https://github.com/prebuild/prebuild-install/commit/477f347)) (csett86). Drops support of Node.js < 10.
- Bump `simple-get` ([`7468c14`](https://github.com/prebuild/prebuild-install/commit/7468c14)) (Vincent Weevers).

## [6.1.4] - 2021-08-11

### Fixed

- Move auth token to header instead of query param ([#160](https://github.com/prebuild/prebuild-install/issues/160)) ([`b3fad76`](https://github.com/prebuild/prebuild-install/commit/b3fad76)) (nicolai-nordic)
- Remove `_` prefix as it isn't allowed by npm config ([#153](https://github.com/prebuild/prebuild-install/issues/153)) ([`a964e5b`](https://github.com/prebuild/prebuild-install/commit/a964e5b)) (Tom Boothman)
- Make `rc.path` absolute ([#158](https://github.com/prebuild/prebuild-install/issues/158)) ([`57bcc06`](https://github.com/prebuild/prebuild-install/commit/57bcc06)) (George Waters).

## [6.1.3] - 2021-06-03

### Changed

- Inline no longer maintained `noop-logger` ([#155](https://github.com/prebuild/prebuild-install/issues/155)) ([`e08d75a`](https://github.com/prebuild/prebuild-install/commit/e08d75a)) (Alexandru Dima)
- Point users towards `prebuildify` in README ([#150](https://github.com/prebuild/prebuild-install/issues/150)) ([`5ee1a2f`](https://github.com/prebuild/prebuild-install/commit/5ee1a2f)) (Vincent Weevers)

## [6.1.2] - 2021-04-24

### Fixed

- Support URL-safe strings in scoped packages ([#148](https://github.com/prebuild/prebuild-install/issues/148)) ([`db36c7a`](https://github.com/prebuild/prebuild-install/commit/db36c7a)) (Marco)

## [6.1.1] - 2021-04-04

### Fixed

- Support `force` & `buildFromSource` options in yarn ([#140](https://github.com/prebuild/prebuild-install/issues/140)) ([`8cb1ced`](https://github.com/prebuild/prebuild-install/commit/8cb1ced)) (João Moreno)
- Bump `node-abi` to prevent dedupe (closes [#135](https://github.com/prebuild/prebuild-install/issues/135)) ([`2950fb2`](https://github.com/prebuild/prebuild-install/commit/2950fb2)) (Vincent Weevers)

## [6.1.0] - 2021-04-03

### Added

- Restore local prebuilds feature ([#137](https://github.com/prebuild/prebuild-install/issues/137)) ([`dc4e5ea`](https://github.com/prebuild/prebuild-install/commit/dc4e5ea)) (Wes Roberts). Previously removed in [#81](https://github.com/prebuild/prebuild-install/issues/81) / [`a069253`](https://github.com/prebuild/prebuild-install/commit/a06925378d38ca821bfa93aa4c1fdedc253b2420).

## [6.0.1] - 2021-02-14

### Fixed

- Fixes empty `--tag-prefix` ([#143](https://github.com/prebuild/prebuild-install/issues/143)) ([**@mathiask88**](https://github.com/mathiask88))

## [6.0.0] - 2020-10-23

### Changed

- **Breaking:** don't skip downloads in standalone mode ([`b6f3b36`](https://github.com/prebuild/prebuild-install/commit/b6f3b36)) ([**@vweevers**](https://github.com/vweevers))

### Added

- Document cross platform options ([`e5c9a5a`](https://github.com/prebuild/prebuild-install/commit/e5c9a5a)) ([**@fishbone1**](https://github.com/fishbone1))

### Removed

- **Breaking:** remove `--compile` and `--prebuild` options ([`94f2492`](https://github.com/prebuild/prebuild-install/commit/94f2492)) ([**@vweevers**](https://github.com/vweevers))

### Fixed

- Support npm 7 ([`8acccac`](https://github.com/prebuild/prebuild-install/commit/8acccac), [`08eaf6d`](https://github.com/prebuild/prebuild-install/commit/08eaf6d), [`22175b8`](https://github.com/prebuild/prebuild-install/commit/22175b8)) ([**@vweevers**](https://github.com/vweevers))

## [5.3.6] - 2020-10-20

### Changed

- Replace `mkdirp` dependency with `mkdirp-classic` ([**@ralphtheninja**](https://github.com/ralphtheninja))

[7.1.1]: https://github.com/prebuild/prebuild-install/releases/tag/v7.1.1

[7.1.0]: https://github.com/prebuild/prebuild-install/releases/tag/v7.1.0

[7.0.1]: https://github.com/prebuild/prebuild-install/releases/tag/v7.0.1

[7.0.0]: https://github.com/prebuild/prebuild-install/releases/tag/v7.0.0

[6.1.4]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.4

[6.1.3]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.3

[6.1.2]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.2

[6.1.1]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.1

[6.1.0]: https://github.com/prebuild/prebuild-install/releases/tag/v6.1.0

[6.0.1]: https://github.com/prebuild/prebuild-install/releases/tag/v6.0.1

[6.0.0]: https://github.com/prebuild/prebuild-install/releases/tag/v6.0.0

[5.3.6]: https://github.com/prebuild/prebuild-install/releases/tag/v5.3.6
81 changes: 68 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,36 @@
# prebuild-install

> A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform.
> **A command line tool to easily install prebuilt binaries for multiple versions of Node.js & Electron on a specific platform.**
> By default it downloads prebuilt binaries from a GitHub release.
[![npm](https://img.shields.io/npm/v/prebuild-install.svg)](https://www.npmjs.com/package/prebuild-install)
![Node version](https://img.shields.io/node/v/prebuild-install.svg)
[![Build Status](https://travis-ci.org/prebuild/prebuild-install.svg?branch=master)](https://travis-ci.org/prebuild/prebuild-install)
[![Build status](https://ci.appveyor.com/api/projects/status/6v6hxxwgjrr99pc8/branch/master?svg=true)](https://ci.appveyor.com/project/mathiask88/prebuild-install)
[![david](https://david-dm.org/prebuild/prebuild-install.svg)](https://david-dm.org/prebuild/prebuild-install)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![Test](https://img.shields.io/github/workflow/status/prebuild/prebuild-install/Test?label=test)](https://github.com/prebuild/prebuild-install/actions/workflows/test.yml)
[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript\&logoColor=fff)](https://standardjs.com)
[![Common Changelog](https://common-changelog.org/badge.svg)](https://common-changelog.org)

`prebuild-install` supports installing prebuilt binaries from GitHub by default.
## Note

**Instead of [`prebuild`](https://github.com/prebuild/prebuild) paired with [`prebuild-install`](https://github.com/prebuild/prebuild-install), we recommend [`prebuildify`](https://github.com/prebuild/prebuildify) paired with [`node-gyp-build`](https://github.com/prebuild/node-gyp-build).**

With `prebuildify`, all prebuilt binaries are shipped inside the package that is published to npm, which means there's no need for a separate download step like you find in `prebuild`. The irony of this approach is that it is faster to download all prebuilt binaries for every platform when they are bundled than it is to download a single prebuilt binary as an install script.

Upsides:

1. No extra download step, making it more reliable and faster to install.
2. Supports changing runtime versions locally and using the same install between Node.js and Electron. Reinstalling or rebuilding is not necessary, as all prebuilt binaries are in the npm tarball and the correct one is simply picked on runtime.
3. The `node-gyp-build` runtime dependency is dependency-free and will remain so out of principle, because introducing dependencies would negate the shorter install time.
4. Prebuilt binaries work even if npm install scripts are disabled.
5. The npm package checksum covers prebuilt binaries too.

Downsides:

1. The installed npm package is larger on disk. Using [Node-API](https://nodejs.org/api/n-api.html) alleviates this because Node-API binaries are runtime-agnostic and forward-compatible.
2. Publishing is mildly more complicated, because `npm publish` must be done after compiling and fetching prebuilt binaries (typically in CI).

## Usage

Change your package.json install script to:
Use [`prebuild`](https://github.com/prebuild/prebuild) to create and upload prebuilt binaries. Then change your package.json install script to:

```json
{
@@ -23,9 +40,17 @@ Change your package.json install script to:
}
```

### Requirements
When a consumer then installs your package with npm thus triggering the above install script, `prebuild-install` will download a suitable prebuilt binary, or exit with a non-zero exit code if there is none, which triggers `node-gyp rebuild` in order to build from source.

You need to provide prebuilds made by [`prebuild`](https://github.com/prebuild/prebuild).
Options (see below) can be passed to `prebuild-install` like so:

```json
{
"scripts": {
"install": "prebuild-install -r napi || node-gyp rebuild"
}
}
```

### Help

@@ -37,6 +62,8 @@ prebuild-install [options]
--runtime -r runtime (Node runtime [node, napi or electron] to build or install for, default is node)
--path -p path (make a prebuild-install here)
--token -T gh-token (github token for private repos)
--arch arch (target CPU architecture, see Node OS module docs, default is current arch)
--platform platform (target platform, see Node OS module docs, default is current platform)
--tag-prefix <prefix> (github tag prefix, default is "v")
--build-from-source (skip prebuild download)
--verbose (log verbosely)
@@ -45,9 +72,13 @@ prebuild-install [options]
--version (print prebuild-install version and exit)
```

When `prebuild-install` is run via an `npm` script, options
`--build-from-source`, `--debug` and `--download`, may be passed through via
arguments given to the `npm` command.
When `prebuild-install` is run via an `npm` script, options `--build-from-source`, `--debug`, `--download`, `--target`, `--runtime`, `--arch` `--platform` and `--libc` may be passed through via arguments given to the `npm` command.

Alternatively you can set environment variables `npm_config_build_from_source=true`, `npm_config_platform`, `npm_config_arch`, `npm_config_target` `npm_config_runtime` and `npm_config_libc`.

### Libc

On non-glibc Linux platforms, the Libc name is appended to platform name. For example, musl-based environments are called `linuxmusl`. If `--libc=glibc` is passed as option, glibc is discarded and platform is called as just `linux`. This can be used for example to build cross-platform packages on Alpine Linux.

### Private Repositories

@@ -95,6 +126,22 @@ So if you are installing `leveldown@1.2.3` the resulting url will be:
http://overriden-host.com/overriden-path/v1.2.3/leveldown-v1.2.3-node-v57-win32-x64.tar.gz
```

#### Local prebuilds

If you want to use prebuilds from your local filesystem, you can use the `% your package name %_local_prebuilds` .npmrc variable to set a path to the folder containing prebuilds. For example:

```
leveldown_local_prebuilds=/path/to/prebuilds
```

This option will look directly in that folder for bundles created with `prebuild`, for example:

```
/path/to/prebuilds/leveldown-v1.2.3-node-v57-win32-x64.tar.gz
```

Non-absolute paths resolve relative to the directory of the package invoking prebuild-install, e.g. for nested dependencies.

### Cache

All prebuilt binaries are cached to minimize traffic. So first `prebuild-install` picks binaries from the cache and if no binary could be found, it will be downloaded. Depending on the environment, the cache folder is determined in the following order:
@@ -103,6 +150,14 @@ All prebuilt binaries are cached to minimize traffic. So first `prebuild-install
- `${APP_DATA}/npm-cache/_prebuilds`
- `${HOME}/.npm/_prebuilds`

## Install

With [npm](https://npmjs.org) do:

```
npm install prebuild-install
```

## License

MIT
[MIT](./LICENSE)
40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

24 changes: 10 additions & 14 deletions asset.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
var get = require('simple-get')
var util = require('./util')
var proxy = require('./proxy')
var noop = Object.assign({
http: function () {},
silly: function () {}
}, require('noop-logger'))
const get = require('simple-get')
const util = require('./util')
const proxy = require('./proxy')

function findAssetId (opts, cb) {
var downloadUrl = util.getDownloadUrl(opts)
var apiUrl = util.getApiUrl(opts)
var log = opts.log || noop
const downloadUrl = util.getDownloadUrl(opts)
const apiUrl = util.getApiUrl(opts)
const log = opts.log || util.noopLogger

log.http('request', 'GET ' + apiUrl)
var reqOpts = proxy({
const reqOpts = proxy({
url: apiUrl,
json: true,
headers: {
@@ -21,15 +17,15 @@ function findAssetId (opts, cb) {
}
}, opts)

var req = get.concat(reqOpts, function (err, res, data) {
const req = get.concat(reqOpts, function (err, res, data) {
if (err) return cb(err)
log.http(res.statusCode, apiUrl)
if (res.statusCode !== 200) return cb(err)

// Find asset id in release
for (var release of data) {
for (const release of data) {
if (release.tag_name === opts['tag-prefix'] + opts.pkg.version) {
for (var asset of release.assets) {
for (const asset of release.assets) {
if (asset.browser_download_url === downloadUrl) {
return cb(null, asset.id)
}
Loading