Skip to content

Commit

Permalink
Remove .git extensions from url
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatakeshi committed Nov 12, 2019
1 parent e8bceac commit 3bd94ee
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/utils/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export default (url: string, options: GitlyOptions = {}): URLInfo => {
function normalizeURL(url: string, options: any) {
// Remove 'www.'
url = url.replace('www.', '')
// Remove '.git'
url = url.replace('.git', '')
const httpRegex = /http(s)?\:\/\//
const tldRegex = /[\S]+\.([\D]+)/
let host = options.host || ''
Expand Down

0 comments on commit 3bd94ee

Please sign in to comment.