Skip to content

Commit

Permalink
Actually build dist code
Browse files Browse the repository at this point in the history
  • Loading branch information
Gordey Doronin committed Apr 21, 2021
1 parent e0469dd commit b917c70
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = function (repoUrl, opts) {
if (!hostname) { return null }
if (hostname !== 'github.com' && hostname !== 'www.github.com' && !opts.enterprise) { return null }

var parts = pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\w-_\.\/]+)?(\/blob\/[\w-_\.\/]+)?/)
var parts = pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\%\w-_\.\/]+)?(\/blob\/[\%\w-_\.\/]+)?/)
// ([\w-_\.]+)
if (!parts) { return null }
obj.user = parts[1]
Expand All @@ -59,9 +59,11 @@ module.exports = function (repoUrl, opts) {
obj.branch = 'master'
obj.path = parts[3].replace(/\/$/, '')
} else if (parts[3]) {
obj.branch = parts[3].replace(/^\/tree\//, '').match(/[\w-_.]+\/{0,1}[\w-_]+/)[0]
var branchMatch = parts[3].replace(/^\/tree\//, '').match(/[\%\w-_.]*\/?[\%\w-_]+/)
obj.branch = branchMatch && branchMatch[0]
} else if (parts[4]) {
obj.branch = parts[4].replace(/^\/blob\//, '').match(/[\w-_.]+\/{0,1}[\w-_]+/)[0]
var branchMatch = parts[4].replace(/^\/blob\//, '').match(/[\%\w-_.]*\/?[\%\w-_]+/)
obj.branch = branchMatch && branchMatch[0]
} else {
obj.branch = 'master'
}
Expand Down
8 changes: 5 additions & 3 deletions dist/gh.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = function (repoUrl, opts) {
if (!hostname) { return null }
if (hostname !== 'github.com' && hostname !== 'www.github.com' && !opts.enterprise) { return null }

var parts = pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\w-_\.\/]+)?(\/blob\/[\w-_\.\/]+)?/)
var parts = pathname.match(/^\/([\w-_]+)\/([\w-_\.]+)(\/tree\/[\%\w-_\.\/]+)?(\/blob\/[\%\w-_\.\/]+)?/)
// ([\w-_\.]+)
if (!parts) { return null }
obj.user = parts[1]
Expand All @@ -60,9 +60,11 @@ module.exports = function (repoUrl, opts) {
obj.branch = 'master'
obj.path = parts[3].replace(/\/$/, '')
} else if (parts[3]) {
obj.branch = parts[3].replace(/^\/tree\//, '').match(/[\w-_.]+\/{0,1}[\w-_]+/)[0]
var branchMatch = parts[3].replace(/^\/tree\//, '').match(/[\%\w-_.]*\/?[\%\w-_]+/)
obj.branch = branchMatch && branchMatch[0]
} else if (parts[4]) {
obj.branch = parts[4].replace(/^\/blob\//, '').match(/[\w-_.]+\/{0,1}[\w-_]+/)[0]
var branchMatch = parts[4].replace(/^\/blob\//, '').match(/[\%\w-_.]*\/?[\%\w-_]+/)
obj.branch = branchMatch && branchMatch[0]
} else {
obj.branch = 'master'
}
Expand Down

0 comments on commit b917c70

Please sign in to comment.