• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript electron-builder-util.isEmptyOrSpaces函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中electron-builder-util.isEmptyOrSpaces函数的典型用法代码示例。如果您正苦于以下问题:TypeScript isEmptyOrSpaces函数的具体用法?TypeScript isEmptyOrSpaces怎么用?TypeScript isEmptyOrSpaces使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了isEmptyOrSpaces函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: checkMetadata

export function checkMetadata(metadata: Metadata, devMetadata: any | null, appPackageFile: string, devAppPackageFile: string): void {
  const errors: Array<string> = []
  const reportError = (missedFieldName: string) => {
    errors.push(`Please specify '${missedFieldName}' in the package.json (${appPackageFile})`)
  }

  const checkNotEmpty = (name: string, value: string | n) => {
    if (isEmptyOrSpaces(value)) {
      reportError(name)
    }
  }

  if ((metadata as any).directories != null) {
    errors.push(`"directories" in the root is deprecated, please specify in the "build"`)
  }

  checkNotEmpty("name", metadata.name)

  if (isEmptyOrSpaces(metadata.description)) {
    warn(`description is missed in the package.json (${appPackageFile})`)
  }
  if (!metadata.author) {
    warn(`author is missed in the package.json (${appPackageFile})`)
  }
  checkNotEmpty("version", metadata.version)

  if (devMetadata != null) {
    checkDependencies(devMetadata.dependencies, errors)
  }
  if (metadata !== devMetadata) {
    checkDependencies(metadata.dependencies, errors)

    if (metadata.build != null) {
      errors.push(`'build' in the application package.json (${appPackageFile}) is not supported since 3.0 anymore. Please move 'build' into the development package.json (${devAppPackageFile})`)
    }
  }

  const devDependencies = (metadata as any).devDependencies
  if (devDependencies != null && "electron-rebuild" in devDependencies) {
    log('electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies\n\nTo ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`')
  }

  if (errors.length > 0) {
    throw new Error(errors.join("\n"))
  }
}
开发者ID:yuya-oc,项目名称:electron-builder,代码行数:46,代码来源:packageMetadata.ts


示例2: findIdentity

export function findIdentity(certType: CertType, qualifier?: string | null, keychain?: string | null): Promise<Identity | null> {
  let identity = qualifier || process.env.CSC_NAME
  if (isEmptyOrSpaces(identity)) {
    if (isAutoDiscoveryCodeSignIdentity()) {
      return _findIdentity(certType, null, keychain)
    }
    else {
      return BluebirdPromise.resolve(null)
    }
  }
  else {
    identity = identity!.trim()
    for (const prefix of appleCertificatePrefixes) {
      checkPrefix(identity, prefix)
    }
    return _findIdentity(certType, identity, keychain)
  }
}
开发者ID:yuya-oc,项目名称:electron-builder,代码行数:18,代码来源:codeSign.ts


示例3: build

export async function build(rawOptions?: CliOptions): Promise<Array<string>> {
  const options = normalizeOptions(rawOptions || {})

  if (options.cscLink === undefined && !isEmptyOrSpaces(process.env.CSC_LINK)) {
    options.cscLink = process.env.CSC_LINK
  }
  if (options.cscInstallerLink === undefined && !isEmptyOrSpaces(process.env.CSC_INSTALLER_LINK)) {
    options.cscInstallerLink = process.env.CSC_INSTALLER_LINK
  }
  if (options.cscKeyPassword === undefined && !isEmptyOrSpaces(process.env.CSC_KEY_PASSWORD)) {
    options.cscKeyPassword = process.env.CSC_KEY_PASSWORD
  }
  if (options.cscInstallerKeyPassword === undefined && !isEmptyOrSpaces(process.env.CSC_INSTALLER_KEY_PASSWORD)) {
    options.cscInstallerKeyPassword = process.env.CSC_INSTALLER_KEY_PASSWORD
  }

  if (options.draft === undefined && !isEmptyOrSpaces(process.env.EP_DRAFT)) {
    options.draft = process.env.EP_DRAFT!.toLowerCase() === "true"
  }
  if (options.prerelease === undefined && !isEmptyOrSpaces(process.env.EP_PRELEASE)) {
    options.prerelease = process.env.EP_PRELEASE!.toLowerCase() === "true"
  }

  const cancellationToken = new CancellationToken()
  const packager = new Packager(options, cancellationToken)
  // because artifact event maybe dispatched several times for different publish providers
  const artifactPaths = new Set<string>()
  packager.artifactCreated(event => {
    if (event.file != null) {
      artifactPaths.add(event.file)
    }
  })

  const publishManager = new PublishManager(packager, options, cancellationToken)
  process.on("SIGINT", () => {
    warn("Cancelled by SIGINT")
    cancellationToken.cancel()
    publishManager.cancelTasks()
  })

  return await executeFinally(packager.build().then(() => Array.from(artifactPaths)), errorOccurred => {
    if (errorOccurred) {
      publishManager.cancelTasks()
      return BluebirdPromise.resolve(null)
    }
    else {
      return publishManager.awaitTasks()
    }
  })
}
开发者ID:yuya-oc,项目名称:electron-builder,代码行数:50,代码来源:builder.ts


示例4: reportError

 const checkNotEmpty = (name: string, value: string | n) => {
   if (isEmptyOrSpaces(value)) {
     reportError(name)
   }
 }
开发者ID:yuya-oc,项目名称:electron-builder,代码行数:5,代码来源:packageMetadata.ts



注:本文中的electron-builder-util.isEmptyOrSpaces函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript electron-builder-util.log函数代码示例发布时间:2022-05-25
下一篇:
TypeScript electron-builder-util.exec函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap