-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add repositoryResolver option to mgit.json #30
Comments
Actually, let's make it a bit differently. This will be the default values:
And each of these options will have a CLI alternative:
|
I proposed two more options – |
The proposed options:
|
To be consistent with CLI standard:
Etc. |
And remember about update the README file. |
Turns out that |
OK, so if I haven't missed anything, the default resolver will look like this: 'use strict';
const parseRepositoryUrl = require( './utils/parserepositoryurl' );
/**
* Resolves repository URL for a given package name.
*
* @param {String} name Package name.
* @param {Object} options TODO
* @returns {Repository|null}
*/
module.exports = function repositoryResolver( name, options ) {
let repositoryUrl = options.dependencies[ name ];
if ( !repositoryUrl ) {
return null;
}
return parseRepositoryUrl( repositoryUrl, options );
}; The options object is, for simplicty, exactly the same as the options passed to CLI. This way the function is maximally short and hence, can be easilly extended by anyone. |
In some configurations you may want to use a different resolver by default. It shouldn't be necessary to always pass it through CLI args.
The text was updated successfully, but these errors were encountered: