From 12844a146e3636eebefa9e5d02ea1a8edff4fcca Mon Sep 17 00:00:00 2001 From: Peter Geil Date: Thu, 21 Jan 2016 00:32:26 +0100 Subject: [PATCH] When linking use `*` as pkg name format by default --- lib/link.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/link.js b/lib/link.js index 4d55d0f1a..ce25f5003 100644 --- a/lib/link.js +++ b/lib/link.js @@ -67,8 +67,9 @@ exports.link = function(dir, name, options) { if (!pkg.package) pkg.setPackage(pjson.name || dir.split(path.sep).pop()); - // ensure the name abides by the registry package name conventions - if (!registry.load(pkg.registry).constructor.packageNameFormats.some(function(format) { + // ensure the name abides by the registry package name conventions but allow any by default + var pkgNameFormats = registry.load(pkg.registry).constructor.packageNameFormats || ['*']; + if (!pkgNameFormats.some(function(format) { var formatRegEx = new RegExp('^' + format.replace(/\*/g, '[^\/]+') + '$'); return pkg.package.match(formatRegEx); })) @@ -155,7 +156,7 @@ exports.link = function(dir, name, options) { .then(function(aborted) { if (!aborted) ui.log('info', - '\nRun this link command again or %jspm install ' + pkg.exactName + '% to relink changes in the package.json file.\n' + + '\nRun this link command again or %jspm install ' + pkg.exactName + '% to relink changes in the package.json file.\n' + 'Run %jspm install --unlink% to unlink and install all original packages. Linked packages can also be uninstalled normally.'); else ui.log('info', 'Link operation aborted.');