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

When linking use * as pkg name format by default #1449

Merged
Merged
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
7 changes: 4 additions & 3 deletions lib/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}))
Expand Down Expand Up @@ -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.');
Expand Down