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C,WAAZ;AACA,WAAO,IAAI,CAAC,cAAZ;AACA,WAAO,IAAI,CAAC,cAAZ;AACA,WAAO,IAAI,CAAC,YAAZ;AACA,WAAO,IAAI,CAAC,aAAZ;AACA,WAAO,IAAI,CAAC,gBAAZ;AACA,WAAO,IAAI,CAAC,YAAZ;AACA,WAAO,IAAI,CAAC,SAAZ;AACA,WAAO,IAAI,CAAC,YAAZ;AACA,WAAO,IAAI,CAAC,UAAZ;AACA,WAAO,IAAI,CAAC,OAAZ;AACA,WAAO,IAAI,CAAC,IAAZ;AACA,WAAO,IAAI,CAAC,kBAAZ;AACA,WAAO,IAAI,CAAC,IAAZ;AACD;;AACD,SAAO,IAAP;AACD,C","sourcesContent":["import { orNullIfFileNotExist } from \"builder-util/out/promise\"\nimport { readFile } from \"fs-extra\"\nimport { fromUrl, Info } from \"hosted-git-info\"\nimport * as path from \"path\"\nimport { SourceRepositoryInfo } from \"../core\"\nimport { Metadata, RepositoryInfo } from \"..\"\n\nexport function getRepositoryInfo(projectDir: string, metadata?: Metadata, devMetadata?: Metadata | null): Promise<SourceRepositoryInfo | null> {\n return _getInfo(projectDir, (devMetadata == null ? null : devMetadata.repository) || (metadata == null ? null : metadata.repository))\n}\n\nasync function getGitUrlFromGitConfig(projectDir: string): Promise<string | null> {\n const data = await orNullIfFileNotExist(readFile(path.join(projectDir, \".git\", \"config\"), \"utf8\"))\n if (data == null) {\n return null\n }\n\n const conf = data.split(/\\r?\\n/)\n const i = conf.indexOf('[remote \"origin\"]')\n if (i !== -1) {\n let u = conf[i + 1]\n if (!u.match(/^\\s*url =/)) {\n u = conf[i + 2]\n }\n\n if (u.match(/^\\s*url =/)) {\n return u.replace(/^\\s*url = /, \"\")\n }\n }\n return null\n}\n\nasync function _getInfo(projectDir: string, repo?: RepositoryInfo | string | null): Promise<SourceRepositoryInfo | null> {\n if (repo != null) {\n return parseRepositoryUrl(typeof repo === \"string\" ? repo : repo.url)\n }\n\n const slug = process.env.TRAVIS_REPO_SLUG || process.env.APPVEYOR_REPO_NAME\n if (slug != null) {\n const splitted = slug.split(\"/\")\n return {\n user: splitted[0],\n project: splitted[1],\n }\n }\n\n const user = process.env.CIRCLE_PROJECT_USERNA
|