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

Remove broken guard #6

Merged
merged 2 commits into from
Feb 15, 2017
Merged

Remove broken guard #6

merged 2 commits into from
Feb 15, 2017

Conversation

wearhere
Copy link
Contributor

No description provided.

As far as I can tell that `if` statement is _always_ true, since `fileInstallingPath`
is the path to the package running the ‘install’ or ‘postInstall’ script, which
is the package being installed—which is what `$npm_package_name` refers
to.
}

if (fileInstallingPackagePath.match(".+" + process.env.npm_package_name + "$")) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GoGoCarl in what circumstances did you find this to be necessary when you added this in #5? As far as I can tell it's always true in both npm 2 and 3 as I describe here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is a bug; the change you made what was intended!

Copy link
Contributor

Choose a reason for hiding this comment

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

@wearhere Actually, sorry about the previous comment. I meant I would have wanted to check target.match(...). My intentions here were to catch a case where the project that hosts the shared files runs npm install. In this case, the process was running against itself, which was not ideal (but in thinking about it now, in some scenarios, this could be necessary). I would say a better cross-version solution here would be to check to see if the source and the target package names are the same, and reject if that is the case. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a better cross-version solution here would be to check to see if the source and the target package names are the same, and reject if that is the case

Yeah that sounds like it could work!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tracking this bug here #8

@wearhere wearhere merged commit 440fbc6 into master Feb 15, 2017
@wearhere wearhere deleted the jeff/remove_broken_check branch February 15, 2017 00:39
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.

2 participants