fix: set repository authentication when repositoryUrl is set as an option

This commit is contained in:
Pierre Vanduynslager
2018-02-12 16:17:09 -05:00
parent b6837a20a8
commit ce1e74f611
2 changed files with 11 additions and 8 deletions
+3 -3
View File
@@ -42,17 +42,17 @@ module.exports = async (opts, logger) => {
};
}
const repositoryUrl = (await pkgRepoUrl()) || (await repoUrl());
// Set default options values if not defined yet
options = {
branch: 'master',
repositoryUrl: repositoryUrl ? getGitAuthUrl(repositoryUrl) : repositoryUrl,
repositoryUrl: (await pkgRepoUrl()) || (await repoUrl()),
tagFormat: `v\${version}`,
// Remove `null` and `undefined` options so they can be replaced with default ones
...pickBy(options, option => !isUndefined(option) && !isNull(option)),
};
options.repositoryUrl = options.repositoryUrl ? getGitAuthUrl(options.repositoryUrl) : options.repositoryUrl;
debug('options values: %O', options);
return {options, plugins: await plugins(options, pluginsPath, logger)};