strings.js 272 B

1234567891011
  1. exports.getHttpsGitURL = url => {
  2. if (url.startsWith('http')) {
  3. return url.replace('.git', '')
  4. } else if (url.startsWith('git@')) {
  5. return url
  6. .replace(':', '/')
  7. .replace('git@', 'https://')
  8. .replace(/.git([^.git]*)$/, '')
  9. }
  10. return url
  11. }