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: avh4/binwrap
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 9f6efb70e24fc422d3a591f075f06b44c65160df
Choose a base ref
...
head repository: avh4/binwrap
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 91461778fceb04b8ccda59d0a28eddbec8f423f2
Choose a head ref

Commits on May 14, 2019

  1. Copy the full SHA
    d2c9371 View commit details

Commits on May 25, 2019

  1. Copy the full SHA
    950c4b9 View commit details

Commits on Jul 21, 2019

  1. Update dependencies

    avh4 committed Jul 21, 2019
    Copy the full SHA
    e7df24d View commit details
  2. Update eslint dependency

    avh4 committed Jul 21, 2019
    Copy the full SHA
    df7ca28 View commit details
  3. Update dependencies

    avh4 committed Jul 21, 2019
    Copy the full SHA
    1208bd4 View commit details
  4. Copy the full SHA
    b027d17 View commit details
  5. Copy the full SHA
    b4aec7e View commit details
  6. Copy the full SHA
    4384a9c View commit details
  7. Copy the full SHA
    6cd4933 View commit details
  8. Merge branch 'fix_crash' of https://github.com/MorganPersson/binwrap

    …into fix-upgrades
    avh4 committed Jul 21, 2019
    Copy the full SHA
    6fda752 View commit details
  9. Merge pull request #32 from avh4/fix-upgrades

    Fix "Error: EEXIST: file already exists" when upgrading
    avh4 authored Jul 21, 2019
    Copy the full SHA
    7640a0e View commit details
  10. Reduce startup time by only parsing package details when the brinarie…

    …s are not yet downloaded
    avh4 committed Jul 21, 2019
    Copy the full SHA
    c011c14 View commit details
  11. Merge pull request #33 from avh4/faster-startup

    Reduce startup time by only parsing package details when the brinarie…
    avh4 authored Jul 21, 2019
    Copy the full SHA
    80c1a21 View commit details

Commits on Aug 7, 2019

  1. Prepare 0.2.2 release

    avh4 committed Aug 7, 2019
    Copy the full SHA
    d69882e View commit details
  2. 0.2.2

    avh4 committed Aug 7, 2019
    Copy the full SHA
    de57918 View commit details

Commits on Aug 9, 2019

  1. Merge pull request #34 from avh4/release/0.2.2

    Finish 0.2.2 release
    avh4 authored Aug 9, 2019
    Copy the full SHA
    70473a3 View commit details

Commits on Nov 15, 2019

  1. Upgrade dependencies

    avh4 committed Nov 15, 2019
    Copy the full SHA
    143fac7 View commit details
  2. Merge pull request #42 from avh4/upgrade-deps

    Upgrade dependencies
    avh4 authored Nov 15, 2019
    Copy the full SHA
    ab6770b View commit details

Commits on May 30, 2020

  1. Get rid of lodash

    lydell committed May 30, 2020
    Copy the full SHA
    f0042eb View commit details

Commits on Jun 1, 2020

  1. Get rid of mustache too

    lydell committed Jun 1, 2020
    Copy the full SHA
    cee0b45 View commit details

Commits on Feb 4, 2021

  1. Update npm dependencies

    avh4 committed Feb 4, 2021
    Copy the full SHA
    a41e725 View commit details
  2. Merge branch 'get-rid-of-lodash' of https://github.com/lydell/binwrap

    …into release/2.3.0
    avh4 committed Feb 4, 2021
    Copy the full SHA
    fe7124f View commit details
  3. Clean up removal of mustache

    avh4 committed Feb 4, 2021
    Copy the full SHA
    89363b8 View commit details
  4. Update documentation for 0.2.3

    avh4 committed Feb 4, 2021
    Copy the full SHA
    98a0453 View commit details
  5. Copy the full SHA
    c602a4a View commit details
  6. Update publishing instructions

    avh4 committed Feb 4, 2021
    Copy the full SHA
    04a675a View commit details
  7. 0.2.3

    avh4 committed Feb 4, 2021
    Copy the full SHA
    9146177 View commit details
Showing with 1,441 additions and 989 deletions.
  1. +0 −3 .travis.yml
  2. +11 −0 CHANGELOG.md
  3. +1 −1 PUBLISHING.md
  4. +12 −1 README.md
  5. +5 −1 binstall.js
  6. +5 −3 binstub.js.mustache
  7. +1,363 −943 package-lock.json
  8. +9 −11 package.json
  9. +1 −2 prepare.js
  10. +18 −24 test.js
  11. +16 −0 test/binwrapTest.js
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,3 @@ node_js:
- "8"
- "10"
- "12"

before_script:
- (cd test_app && npm install ../)
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## 0.2.3

- HTTP error codes are handled more correctly when package authors test their packages
- removed dependency on request-promise and mustache


## 0.2.2

- startup time is reduces by 70% (about 150ms)
- installing should no longer fail if a previous version exists (such as when upgrading)

2 changes: 1 addition & 1 deletion PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to publish this package

1. Make sure the README is up-to-date for the new version (commit changes if necessary)
1. make sure tests pass locally `rm -Rf ./node_modules && npm install && npm test`
1. make sure tests pass locally `rm -Rf ./node_modules && npm ci && npm test`
1. `npm version <the new version>` (this creates the git tag)
1. `git push origin v<the new version>`
1. wait for CI to pass on the tagged version <https://travis-ci.org/avh4/binwrap>
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ Now create your npm installer: Make a `package.json` that looks like this:
"myapp-cli": "bin/myapp-cli"
},
"dependencies": {
"binwrap": "^0.2.1"
"binwrap": "^0.2.3"
}
}
```
@@ -62,3 +62,14 @@ module.exports = binwrap({
Then run `npm test` to verify that your packages are published correctly.

Finally, run `npm publish` when you are ready to publish your installer.


## Javascript API

Javascript code can get the absolute path to a binary from a package that uses binwrap
as follows (in this example, "my-package" is a published npm package that uses binwrap,
and has a `my-package-cli` binary):

```js
const cliPath = require('my-package').paths['my-package-cli'];
```
6 changes: 5 additions & 1 deletion binstall.js
Original file line number Diff line number Diff line change
@@ -42,7 +42,11 @@ function untgz(url, path, options) {
reject("Error decompressing " + url + " " + error);
});

fs.mkdirSync(path);
try {
fs.mkdirSync(path);
} catch (error) {
if (error.code !== 'EEXIST') throw error;
}

request
.get(url, function(error, response) {
8 changes: 5 additions & 3 deletions binstub.js.mustache
Original file line number Diff line number Diff line change
@@ -2,8 +2,6 @@
var path = require("path");
var spawn = require("child_process").spawn;
var fs = require("fs");
var packageInfo = require(path.join(__dirname, "..", "package.json"));
var package = require(path.join(__dirname, "..", packageInfo.main));

var os = process.env.BINWRAP_PLATFORM || process.platform;
var arch = process.env.BINWRAP_ARCH || process.arch;
@@ -20,7 +18,7 @@ if (os == "win32") {
}

var unpackedBinPath = path.join(__dirname, "..", "unpacked_bin");
var binPath = path.join(unpackedBinPath, "{{ binName }}" + binExt);
var binPath = path.join(unpackedBinPath, {{ binName }} + binExt);

function execBin() {
spawn(
@@ -34,6 +32,10 @@ if (fs.existsSync(binPath)) {
execBin();
} else {
console.error("INFO: Running " + path.basename(__filename) + " for the first time; downloading the actual binary");

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

package.install(unpackedBinPath, os, arch).then(function(result) {
execBin();
}, function(err) {
Loading