当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript log.debug方法代码示例

本文整理汇总了TypeScript中builder-util/out/util.log.debug方法的典型用法代码示例。如果您正苦于以下问题:TypeScript log.debug方法的具体用法?TypeScript log.debug怎么用?TypeScript log.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在builder-util/out/util.log的用法示例。


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

示例1: getCertificateFromStoreInfo

export async function getCertificateFromStoreInfo(options: WindowsConfiguration, vm: VmManager): Promise<CertificateFromStoreInfo> {
  const certificateSubjectName = options.certificateSubjectName
  const certificateSha1 = options.certificateSha1
  // ExcludeProperty doesn't work, so, we cannot exclude RawData, it is ok
  // powershell can return object if the only item
  const rawResult = await vm.exec("powershell.exe", ["Get-ChildItem -Recurse Cert: -CodeSigningCert | Select-Object -Property Subject,PSParentPath,Thumbprint | ConvertTo-Json -Compress"])
  const certList = rawResult.length === 0 ? [] : asArray<CertInfo>(JSON.parse(rawResult))
  for (const certInfo of certList) {
    if (certificateSubjectName != null) {
      if (!certInfo.Subject.includes(certificateSubjectName)) {
        continue
      }
    }
    else if (certInfo.Thumbprint !== certificateSha1) {
      continue
    }

    const parentPath = certInfo.PSParentPath
    const store = parentPath.substring(parentPath.lastIndexOf("\\") + 1)
    log.debug({store, PSParentPath: parentPath}, "auto-detect certificate store")
    // https://github.com/electron-userland/electron-builder/issues/1717
    const isLocalMachineStore = (parentPath.includes("Certificate::LocalMachine"))
    log.debug(null, "auto-detect using of LocalMachine store")
    return {
      thumbprint: certInfo.Thumbprint,
      subject: certInfo.Subject,
      store,
      isLocalMachineStore
    }
  }

  throw new Error(`Cannot find certificate ${certificateSubjectName || certificateSha1}, all certs: ${rawResult}`)
}
开发者ID:electron-userland,项目名称:electron-builder,代码行数:33,代码来源:windowsCodeSign.ts


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