generators/init-product/templates/plain/build.js
function guessUserName(repo) {
  // extract the host
  const host = repo.match(/:\/\/([^/]+)/)[1];
  const hostClean = host.replace(/\./g, '_').toUpperCase();
  // e.g. GITHUB_COM_CREDENTIALS
  const envVar = process.env[`${hostClean}_CREDENTIALS`];
  if (envVar) {
    return envVar;
  }
  return process.env.PHOVEA_GITHUB_CREDENTIALS;
}
function guessUserName(repo) {
  // extract the host
  const host = repo.match(/:\/\/([^/]+)/)[1];
  const hostClean = host.replace(/\./g, '_').toUpperCase();
  // e.g. GITHUB_COM_CREDENTIALS
  const envVar = process.env[`${hostClean}_CREDENTIALS`];
  if (envVar) {
    return envVar;
  }
  return process.env.PHOVEA_GITHUB_CREDENTIALS;
}
function guessUserName ( repo ) { // extract the host const host = repo . match ( / :\/\/([^/]+) / ) [ 1 ] ; const hostClean = host . replace ( / \. / g , '_' ) . toUpperCase ( ) ; // e.g. GITHUB_COM_CREDENTIALS const envVar = process . env [ ` ${ hostClean } ` ] ; if ( envVar ) { return envVar ; } return process . env . PHOVEA_GITHUB_CREDENTIALS ; }
guesses the credentials environment variable based on the given repository hostname
@param {string} repo
guesses the credentials environment variable based on the given repository hostname