Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Fix linking of scoped modules #8975

Merged
merged 1 commit into from Jul 18, 2015
Merged

Fix linking of scoped modules #8975

merged 1 commit into from Jul 18, 2015

Conversation

iarna
Copy link
Contributor

@iarna iarna commented Jul 17, 2015

Linking scoped modules was failing due to a check intended to see if the module was installed in the global directory. This did the classic path.resolve(blah, '..') which always, ALWAYS fails for scoped modules. Alas. Adds a test for this scenario too.

@iarna iarna added this to the 3.1.3 milestone Jul 17, 2015
@iarna iarna force-pushed the iarna/fix-link-scoped branch 2 times, most recently from 8eb88c8 to d8ec61b Compare July 17, 2015 09:49
@@ -50,6 +50,14 @@ function link (args, cb) {
linkPkg(npm.prefix, cb)
}

function parentFolder (id, folder) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe I'm overly paranoid, but I'd also like a check that guarantees there's a / in the name before adding a second parent directory into the mix. Is that too paranoid?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The worst case scenario here if a / is missing is that it refuses to link the module. And given that it's invalid to start a module name with '@' and not have it be a scoped module, I'm not concerned about that happening.

Copy link
Contributor

Choose a reason for hiding this comment

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

You have more faith in software to not do the most perverse possible thing than I do, but I defer to your judgment.

@othiym23
Copy link
Contributor

Question / paranoia aside, LGTM. 🐑

@iarna iarna merged commit fdb360f into release-3.1.3 Jul 18, 2015
@iarna iarna removed the in-progress label Jul 18, 2015
@iarna iarna deleted the iarna/fix-link-scoped branch July 20, 2015 06:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants