当前位置: 首页>>代码示例>>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;未经允许,请勿转载。