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

Treat prepublish as publish; preinstall as install #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ function inCommand (cmd) {
if (!npm_config_argv.cooked instanceof Array) process.exit(1)

var V
if (npm_config_argv.cooked[0] === 'run') npm_config_argv.cooked.shift()
Copy link
Owner

Choose a reason for hiding this comment

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

You're strippping the first argument if it's run but I don't get what problem you're solving?

It looks like you're trying to make npm run prepublish be detectable? Why?

Copy link
Author

Choose a reason for hiding this comment

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

Per #10, lerna bootstrap runs npm prepublish in each package directory to get it ready for a symlink from one of its dependencies.

while ((V = npm_config_argv.cooked.shift()) !== undefined) {
if (/^-/.test(V)) continue
if (cmd.test(V)) return true
Expand All @@ -20,9 +21,9 @@ function inCommand (cmd) {
}

exports.inPublish = function () {
return inCommand(/^pu(b(l(i(sh?)?)?)?)?$/)
return inCommand(/^(?:pre)?pu(b(l(i(sh?)?)?)?)?$/)
}

exports.inInstall = function () {
return inCommand(/^i(n(s(t(a(ll?)?)?)?)?)?$/)
return inCommand(/^(?:pre)?i(n(s(t(a(ll?)?)?)?)?)?$/)
Ronald1M marked this conversation as resolved.
Show resolved Hide resolved
}