Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// set this up first, so we can use 127.0.0.1 as our "hosted git" service
const httpPort = 18000 + (+process.env.TAP_CHILD_ID || 0)
const hostedUrl = `http://localhost:${httpPort}`
const ghi = require('hosted-git-info/git-host-info.js')
const gitPort = 12345 + (+process.env.TAP_CHILD_ID || 0)
ghi.localhost = {
protocols: [ 'git+https', 'git+ssh' ],
domain: `127.0.0.1:${gitPort}`,
httpstemplate: 'git://{domain}/{user}{#committish}',
treepath: 'not-implemented',
tarballtemplate: `${hostedUrl}/repo-HEAD.tgz`,
// shortcut MUST have a user and project, at least
shortcuttemplate: '{type}:{user}/x{#committish}',
pathtemplate: '/{user}{#committish}',
pathmatch: /^\/(repo|submodule-repo)/,
hashformat: h => h,
protocols_re: /^(git):$/
}
ghi.localhostssh = {
protocols: [ 'git+ssh' ],
domain: `localhostssh:${gitPort}`,
sshtemplate: `git://127.0.0.1:${gitPort}/{user}{#committish}`,