git-release-manager
Version:
A tool to generate release notes from git commit history
14 lines • 615 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseRemoteUrl = parseRemoteUrl;
function parseRemoteUrl(remoteUrl) {
if (!remoteUrl)
return null;
const match = RegExp(/(?:https?:\/\/|git@)([\w.-]+)(?:[:/])([\w.-]+)\/([\w.-]+?)(?:\.git)?$/i).exec(remoteUrl);
if (!match)
throw new Error(`Could not parse remote URL: ${remoteUrl}`);
const [_, host, owner, repository] = match;
const repoUrl = `https://${host}/${owner}/${repository}`;
return { url: remoteUrl, host, owner, repository, repoUrl };
}
//# sourceMappingURL=remoteHandler.js.map