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

Use binary destination set in package.json #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Use binary destination set in package.json #34

wants to merge 1 commit into from

Conversation

kevva
Copy link
Owner

@kevva kevva commented Dec 30, 2014

Currently, this will probably break if .use() is something like path/bin, and if it differs from the binary name in package.json, e.g:

.use('asd.exe');
{
  "bin": {
    "asd": "bin/asd"
  }
}

Fixes #31.

@sindresorhus
Copy link
Contributor

ping @kevva

@kevva
Copy link
Owner Author

kevva commented Mar 14, 2015

Yeah, is module.parent.filename reliable to use to get caller modules package.json?

@sindresorhus
Copy link
Contributor

delete require.cache[__filename];

var dir = path.dirname(module.parent.filename);
var pkg = require(find('package.json', { cwd: dir }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grushikhin
Copy link

Hello!
Is there any chance that you will merge this feature to the master?
I can help with resolving conflicts and updating branch.
I really want to have this feature :)

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

Successfully merging this pull request may close these issues.

Simplify bin creation
3 participants