當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript hosted-git-info.fromUrl函數代碼示例

本文整理匯總了TypeScript中hosted-git-info.fromUrl函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript fromUrl函數的具體用法?TypeScript fromUrl怎麽用?TypeScript fromUrl使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了fromUrl函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: parseRepositoryUrl

function parseRepositoryUrl(url: string): Info {
  const info: any = fromUrl(url)
  if (info != null) {
    delete info.protocols
    delete info.treepath
    delete info.filetemplate
    delete info.bugstemplate
    delete info.gittemplate
    delete info.tarballtemplate
    delete info.sshtemplate
    delete info.sshurltemplate
    delete info.browsetemplate
    delete info.docstemplate
    delete info.httpstemplate
    delete info.shortcuttemplate
    delete info.pathtemplate
    delete info.pathmatch
    delete info.protocols_re
    delete info.committish
    delete info.default
    delete info.opts
    delete info.browsefiletemplate
    delete info.auth
  }
  return info
}
開發者ID:electron-userland,項目名稱:electron-builder,代碼行數:26,代碼來源:repositoryInfo.ts

示例2: _getInfo

async function _getInfo(metadata?: AppMetadata, devMetadata?: Metadata): Promise<RepositorySlug | null> {
  const repo = metadata == null ? null : (devMetadata!.repository || metadata!.repository)
  if (repo == null) {
    let url = process.env.TRAVIS_REPO_SLUG
    if (url == null) {
      const user: string | null = process.env.APPVEYOR_ACCOUNT_NAME || process.env.CIRCLE_PROJECT_USERNAME
      const project: string | null = process.env.APPVEYOR_PROJECT_NAME || process.env.CIRCLE_PROJECT_REPONAME
      if (user != null && project != null) {
        return {
          user: user,
          project: project,
        }
      }

      url = await getGitUrlFromGitConfig()
    }

    if (url != null) {
      return parseRepositoryUrl(url)
    }
  }
  else {
    return parseRepositoryUrl(typeof repo === "string" ? repo : repo.url)
  }
  return null
}
開發者ID:ArchMa9e,項目名稱:electron-builder,代碼行數:26,代碼來源:repositoryInfo.ts

示例3: getInfo

async function getInfo(provider: ProjectMetadataProvider): Promise<RepositorySlug> {
  const repo = provider.devMetadata.repository || provider.metadata.repository
  if (repo == null) {
    let url = process.env.TRAVIS_REPO_SLUG
    if (url == null) {
      const user: string = process.env.APPVEYOR_ACCOUNT_NAME || process.env.CIRCLE_PROJECT_USERNAME
      const project: string = process.env.APPVEYOR_PROJECT_NAME || process.env.CIRCLE_PROJECT_REPONAME
      if (user != null && project != null) {
        return {
          user: user,
          project: project,
        }
      }

      url = await getGitUrlFromGitConfig()
    }

    if (url != null) {
      return parseRepositoryUrl(url)
    }
  }
  else {
    return parseRepositoryUrl(typeof repo === "string" ? repo : repo.url)
  }
  return null
}
開發者ID:RasmusTG,項目名稱:electron-builder,代碼行數:26,代碼來源:repositoryInfo.ts


注:本文中的hosted-git-info.fromUrl函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。