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


TypeScript Promise.resolve方法代码示例

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


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

示例1: constructor

  constructor(info: BuildInfo, cleanupTasks: Array<() => Promise<any>>) {
    super(info)

    const certificateFile = this.platformSpecificBuildOptions.certificateFile
    if (certificateFile != null) {
      const certificatePassword = this.platformSpecificBuildOptions.certificatePassword || this.getCscPassword()
      this.cscInfo = BluebirdPromise.resolve({
        file: certificateFile,
        password: certificatePassword == null ? null : certificatePassword.trim(),
      })
    }
    else if (this.options.cscLink != null) {
      this.cscInfo = downloadCertificate(this.options.cscLink)
        .then(path => {
          cleanupTasks.push(() => deleteFile(path, true))
          return {
            file: path,
            password: this.getCscPassword(),
          }
        })
    }
    else {
      this.cscInfo = BluebirdPromise.resolve(null)
    }

    this.iconPath = this.getValidIconPath()
  }
开发者ID:mairanteodoro,项目名称:electron-builder,代码行数:27,代码来源:winPackager.ts

示例2: pack

  async pack(outDir: string, arch: string, postAsyncTasks: Array<Promise<any>>): Promise<any> {
    if (arch === "ia32") {
      warn("For windows consider only distributing 64-bit, see https://github.com/electron-userland/electron-builder/issues/359#issuecomment-214851130")
    }

    // we must check icon before pack because electron-packager uses icon and it leads to cryptic error message "spawn wine ENOENT"
    await this.iconPath

    const appOutDir = this.computeAppOutDir(outDir, arch)
    const packOptions = this.computePackOptions(outDir, appOutDir, arch)

    if (!this.options.dist) {
      await this.doPack(packOptions, outDir, appOutDir, arch, this.customBuildOptions)
      return
    }

    const installerOut = this.options.dist ? computeDistOut(outDir, arch) : null
    await BluebirdPromise.all([
      this.packApp(packOptions, appOutDir),
      installerOut == null ? BluebirdPromise.resolve() : emptyDir(installerOut)
    ])

    await this.copyExtraResources(appOutDir, arch, this.customBuildOptions)
    if (this.options.dist) {
      postAsyncTasks.push(this.packageInDistributableFormat(outDir, appOutDir, installerOut!, arch, packOptions))
    }
  }
开发者ID:sethlu,项目名称:electron-builder,代码行数:27,代码来源:winPackager.ts

示例3: assertThat

 packed: () => {
   assertThat(platformPackager.effectiveSignOptions).has.properties({
     entitlements: "osx-entitlements file path",
     "entitlements-inherit": "osx-entitlementsInherit file path",
   })
   return BluebirdPromise.resolve(null)
 }
开发者ID:ArchMa9e,项目名称:electron-builder,代码行数:7,代码来源:osxPackagerTest.ts

示例4: deleteOldElectronVersion

function deleteOldElectronVersion(): Promise<any> {
  if (process.env.CI) {
    const cacheDir = path.join(require("os").homedir(), ".electron")
    return fs.readdir(cacheDir)
      .catch(error => {
        if (error.code === "ENOENT") {
          return []
        }
        else {
          throw error
        }
      })
      .then(it => {
        const deletePromises: Array<Promise<any>> = []
        for (let file of it) {
          if (file.endsWith(".zip") && !file.includes(electronVersion)) {
            console.log("Remove old electron " + file)
            deletePromises.push(fs.unlink(path.join(cacheDir, file)))
          }
        }
        return BluebirdPromise.all(deletePromises)
      })
  }
  else {
    return BluebirdPromise.resolve()
  }
}
开发者ID:waifei,项目名称:electron-builder,代码行数:27,代码来源:runTests.ts

示例5: constructor

  constructor(private packager: WinPackager, private outDir: string, private appOutDir: string) {
    if (process.env.USE_SYSTEM_MAKENSIS) {
      this.nsisPath = BluebirdPromise.resolve("makensis")
    }
    else {
      this.nsisPath = getBin("nsis", `nsis-${NSIS_VERSION}`, `https://dl.bintray.com/electron-userland/bin/nsis-${NSIS_VERSION}.7z`, NSIS_SHA2)
    }

    this.nsisOptions = packager.info.devMetadata.build.nsis || Object.create(null)
  }
开发者ID:alchapone,项目名称:electron-builder,代码行数:10,代码来源:nsis.ts

示例6: constructor

  constructor(info: BuildInfo, cleanupTasks: Array<() => Promise<any>>) {
    super(info)

    if (this.options.cscLink != null && this.options.cscKeyPassword != null) {
      const keychainName = generateKeychainName()
      cleanupTasks.push(() => deleteKeychain(keychainName))
      this.codeSigningInfo = createKeychain(keychainName, this.options.cscLink, this.options.cscKeyPassword, this.options.csaLink)
    }
    else {
      this.codeSigningInfo = BluebirdPromise.resolve(null)
    }
  }
开发者ID:michaelbazos,项目名称:electron-builder,代码行数:12,代码来源:macPackager.ts

示例7: signMac

  private signMac(distPath: string, codeSigningInfo: CodeSigningInfo): Promise<any> {
    if (codeSigningInfo == null) {
      codeSigningInfo = {cscName: this.options.sign || process.env.CSC_NAME}
    }

    if (codeSigningInfo.cscName == null) {
      log("App is not signed: CSC_LINK or CSC_NAME are not specified")
      return BluebirdPromise.resolve()
    }
    else {
      log("Signing app")
      return sign(distPath, codeSigningInfo)
    }
  }
开发者ID:michaelbazos,项目名称:electron-builder,代码行数:14,代码来源:macPackager.ts

示例8: constructor

  constructor(info: BuildInfo, cleanupTasks: Array<() => Promise<any>>) {
    super(info)

    // https://developer.mozilla.org/en-US/docs/Signing_an_executable_with_Authenticode
    // https://github.com/Squirrel/Squirrel.Windows/pull/505
    if (this.options.cscLink != null && this.options.cscKeyPassword != null && process.platform !== "darwin") {
      this.certFilePromise = downloadCertificate(this.options.cscLink)
        .then(path => {
          cleanupTasks.push(() => deleteFile(path, true))
          return path
        })
    }
    else {
      this.certFilePromise = BluebirdPromise.resolve(null)
    }
  }
开发者ID:bundyo,项目名称:electron-builder,代码行数:16,代码来源:winPackager.ts

示例9: constructor

  constructor(info: BuildInfo, cleanupTasks: Array<() => Promise<any>>) {
    super(info)

    if (this.options.cscLink != null && this.options.cscKeyPassword != null) {
      this.certFilePromise = downloadCertificate(this.options.cscLink)
        .then(path => {
          cleanupTasks.push(() => deleteFile(path, true))
          return path
        })
    }
    else {
      this.certFilePromise = BluebirdPromise.resolve(null)
    }

    this.iconPath = this.getValidIconPath()
  }
开发者ID:is00hcw,项目名称:electron-builder,代码行数:16,代码来源:winPackager.ts


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