diff --git a/lib/util.js b/lib/util.js index b75479ac..59110af0 100644 --- a/lib/util.js +++ b/lib/util.js @@ -48,10 +48,10 @@ const rejectAfter = (ms, error) => const parseGitUrl = remoteUrl => { if (!remoteUrl) return { host: null, owner: null, project: null, protocol: null, remote: null, repository: null }; - const normalizedUrl = (remoteUrl || '').replace(/\\/g, '/'); + const normalizedUrl = (remoteUrl || '').replace(/^[A-Z]:/, '').replace(/\\/g, '/'); // Hacky workaround for file protocol in Windows const parsedUrl = gitUrlParse(normalizedUrl); const { resource: host, name: project, protocol, href: remote } = parsedUrl; - const owner = protocol === 'file' ? _.last(parsedUrl.owner.split('/')) : parsedUrl.owner; + const owner = protocol === 'file' ? _.last(parsedUrl.owner.split('/')) : parsedUrl.owner; // Fix owner for file protocol const repository = `${owner}/${project}`; return { host, owner, project, protocol, remote, repository }; };