kevva / bin-wrapper

Binary wrapper that makes your programs seamlessly available as local dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bin-wrapper recompiles, no matter if binary is avalible in PATH?

offlinehacker opened this issue · comments

This statement is in all views wrong:

if (isbin(this.bin)) {
    if (!which.sync(self.bin).indexOf('node_modules/.bin')) {
      return which.sync(self.bin);
    }
}

The return part never gets called(actually it does if node_packages/.bin starts at char 0, but i guess that's not a desired behaviour).

Even if i fix this and bin-wrapper finds path, my CPU goes to 100%, and i don't know what's wrong from there on.

node 0.10.12
npm 1.2.32
bin-wrapper 0.1.6

Seems like the problem is that the .bin folder doesn't get excluded on Linux.

!which.sync(self.bin).indexOf('node_modules/.bin') ruturns true only if node_modules/.bin is at index 0,. Please note !0 = true, if string is not found indexOf returns -1 and !-1 = false, i don't think that's desired behaviour?

So which.sync(self.bin).indexOf('node_modules/.bin') === -1 should work?

Exactly +1 :)

On Mon, Oct 28, 2013 at 10:19 AM, Kevin Mårtensson <notifications@github.com

wrote:

Closed #7 #7 via 14ef72314ef723
.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7
.