本文整理汇总了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}`)
}