Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: allow custom git domains (#81)
Browse files Browse the repository at this point in the history
* fix: allow custom git domains

* feat: allow repo link generation for custom domains
  • Loading branch information
koshilki authored and jdx committed Jan 10, 2019
1 parent 11538af commit 37e28d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/readme.ts
Expand Up @@ -177,10 +177,10 @@ USAGE
private repo(plugin: Config.IPlugin): string | undefined {
const pjson = {...plugin.pjson}
normalize(pjson)
let repo = pjson.repository && pjson.repository.url
const repo = pjson.repository && pjson.repository.url
if (!repo) return
let url = new URL(repo)
if (!['github.com', 'gitlab.com'].includes(url.hostname)) return
const url = new URL(repo)
if (!['github.com', 'gitlab.com'].includes(url.hostname) && !pjson.oclif.repositoryPrefix) return
return `https://${url.hostname}${url.pathname.replace(/\.git$/, '')}`
}

Expand Down

0 comments on commit 37e28d9

Please sign in to comment.