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


TypeScript builder-util.isMacOsSierra函数代码示例

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


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

示例1: importCerts

async function importCerts(keychainName: string, paths: Array<string>, keyPasswords: Array<string>): Promise<CodeSigningInfo> {
  for (let i = 0; i < paths.length; i++) {
    const password = keyPasswords[i]
    await exec("security", ["import", paths[i], "-k", keychainName, "-T", "/usr/bin/codesign", "-T", "/usr/bin/productbuild", "-P", password])

    // https://stackoverflow.com/questions/39868578/security-codesign-in-sierra-keychain-ignores-access-control-settings-and-ui-p
    // https://github.com/electron-userland/electron-packager/issues/701#issuecomment-322315996
    if (await isMacOsSierra()) {
      await exec("security", ["set-key-partition-list", "-S", "apple-tool:,apple:", "-s", "-k", password, keychainName])
    }
  }

  return {
    keychainName,
  }
}
开发者ID:jwheare,项目名称:electron-builder,代码行数:16,代码来源:codeSign.ts

示例2: getToolPath

async function getToolPath(): Promise<ToolInfo> {
  if (isUseSystemSigncode()) {
    return {path: "osslsigncode"}
  }

  const result = process.env.SIGNTOOL_PATH
  if (result) {
    return {path: result}
  }

  const vendorPath = await getSignVendorPath()
  if (process.platform === "win32") {
    // use modern signtool on Windows Server 2012 R2 to be able to sign AppX
    if (isOldWin6()) {
      return {path: path.join(vendorPath, "windows-6", "signtool.exe")}
    }
    else {
      return {path: path.join(vendorPath, "windows-10", process.arch, "signtool.exe")}
    }
  }
  else if (process.platform === "darwin") {
    let suffix: string | null = null
    try {
      if (await isMacOsSierra()) {
        const toolDirPath = path.join(vendorPath, process.platform, "10.12")
        return {
          path: path.join(toolDirPath, "osslsigncode"),
          env: computeToolEnv([path.join(toolDirPath, "lib")]),
        }
      }
      else if (isCi) {
        // not clear for what we do this instead of using version detection
        suffix = "ci"
      }
    }
    catch (e) {
      warn(`${e.stack || e}`)
    }
    return {path: path.join(vendorPath, process.platform, `${suffix == null ? "" : `${suffix}/`}osslsigncode`)}
  }
  else {
    return {path: path.join(vendorPath, process.platform, "osslsigncode")}
  }
}
开发者ID:jwheare,项目名称:electron-builder,代码行数:44,代码来源:windowsCodeSign.ts


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