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

TypeScript bluebird-lst-c.all函数代码示例

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

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



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

示例1: buildInstaller

export async function buildInstaller(options: SquirrelOptions, outputDirectory: string, setupExe: string, packager: WinPackager, appOutDir: string) {
  const appUpdate = await packager.getTempFile("Update.exe")
  await BluebirdPromise.all([
    copy(path.join(options.vendorPath, "Update.exe"), appUpdate)
      .then(() => packager.sign(appUpdate)),
    BluebirdPromise.all([remove(`${outputDirectory.replace(/\\/g, "/")}/*-full.nupkg`), remove(path.join(outputDirectory, "RELEASES"))])
      .then(() => ensureDir(outputDirectory))
  ])

  if (options.remoteReleases) {
    await syncReleases(outputDirectory, options)
  }

  const embeddedArchiveFile = await packager.getTempFile("setup.zip")
  const embeddedArchive = archiver("zip", {zlib: {level: options.packageCompressionLevel == null ? 6 : options.packageCompressionLevel}})
  const embeddedArchiveOut = createWriteStream(embeddedArchiveFile)
  const embeddedArchivePromise = new BluebirdPromise(function (resolve, reject) {
    embeddedArchive.on("error", reject)
    embeddedArchiveOut.on("close", resolve)
  })
  embeddedArchive.pipe(embeddedArchiveOut)

  embeddedArchive.file(appUpdate, {name: "Update.exe"})
  embeddedArchive.file(options.loadingGif ? path.resolve(options.loadingGif) : path.join(__dirname, "..", "..", "templates", "install-spinner.gif"), {name: "background.gif"})

  const version = convertVersion(options.version)
  const packageName = `${options.name}-${version}-full.nupkg`
  const nupkgPath = path.join(outputDirectory, packageName)
  const setupPath = path.join(outputDirectory, setupExe || `${options.name || options.productName}Setup.exe`)

  await BluebirdPromise.all<any>([
    pack(options, appOutDir, appUpdate, nupkgPath, version, options.packageCompressionLevel),
    copy(path.join(options.vendorPath, "Setup.exe"), setupPath),
  ])

  embeddedArchive.file(nupkgPath, {name: packageName})

  const releaseEntry = await releasify(options, nupkgPath, outputDirectory, packageName)

  embeddedArchive.append(releaseEntry, {name: "RELEASES"})
  embeddedArchive.finalize()
  await embeddedArchivePromise

  const writeZipToSetup = path.join(options.vendorPath, "WriteZipToSetup.exe")
  await execWine(writeZipToSetup, [setupPath, embeddedArchiveFile])

  await packager.signAndEditResources(setupPath)
  if (options.msi && process.platform === "win32") {
    const outFile = setupExe.replace(".exe", ".msi")
    await msi(options, nupkgPath, setupPath, outputDirectory, outFile)
    // rcedit can only edit .exe resources
    await packager.sign(path.join(outputDirectory, outFile))
  }
}
开发者ID:heinzbeinz,项目名称:electron-builder,代码行数:54,代码来源:squirrelPack.ts


示例2: assertThat

 packed: context => {
   const resources = path.join(context.getResources(Platform.LINUX))
   return BluebirdPromise.all([
     assertThat(path.join(resources, "app", "foo", "old")).doesNotExist(),
     assertThat(path.join(resources, "foo", "new")).isFile(),
   ])
 },
开发者ID:mbrainiac,项目名称:electron-builder,代码行数:7,代码来源:filesTest.ts


示例3: outputFile

 projectDirCreated: projectDir => BluebirdPromise.all([
   outputFile(path.join(projectDir, ".svn", "foo"), "data"),
   outputFile(path.join(projectDir, ".git", "foo"), "data"),
   outputFile(path.join(projectDir, "foo", "bar", "f.o"), "data"),
   outputFile(path.join(projectDir, "node_modules", ".bin", "f.txt"), "data"),
   outputFile(path.join(projectDir, "node_modules", ".bin2", "f.txt"), "data"),
 ]),
开发者ID:Icenium,项目名称:electron-builder,代码行数:7,代码来源:globTest.ts


示例4: modifyPackageJson

      projectDirCreated: projectDir => {
        return BluebirdPromise.all([
          modifyPackageJson(projectDir, data => {
            data.build.extraResources = [
              "foo",
              "bar/hello.txt",
              "bar/${arch}.txt",
              "${os}/${arch}.txt",
            ]

            data.build[osName] = {
              extraResources: [
                "platformSpecificR"
              ],
              extraFiles: [
                "platformSpecificF"
              ],
            }
          }),
          outputFile(path.join(projectDir, "foo/nameWithoutDot"), "nameWithoutDot"),
          outputFile(path.join(projectDir, "bar/hello.txt"), "data"),
          outputFile(path.join(projectDir, `bar/${process.arch}.txt`), "data"),
          outputFile(path.join(projectDir, `${osName}/${process.arch}.txt`), "data"),
          outputFile(path.join(projectDir, "platformSpecificR"), "platformSpecificR"),
          outputFile(path.join(projectDir, "ignoreMe.txt"), "ignoreMe"),
        ])
      },
开发者ID:Icenium,项目名称:electron-builder,代码行数:27,代码来源:globTest.ts


示例5: prepareWine

  async prepareWine(wineDir: string) {
    await emptyDir(wineDir)
    //noinspection SpellCheckingInspection
    const env = Object.assign({}, process.env, {
      WINEDLLOVERRIDES: "winemenubuilder.exe=d",
      WINEPREFIX: wineDir
    })

    await exec("wineboot", ["--init"], {env: env})

    // regedit often doesn't modify correctly
    let systemReg = await readFile(path.join(wineDir, "system.reg"), "utf8")
    systemReg = systemReg.replace('"CSDVersion"="Service Pack 3"', '"CSDVersion"=" "')
    systemReg = systemReg.replace('"CurrentBuildNumber"="2600"', '"CurrentBuildNumber"="10240"')
    systemReg = systemReg.replace('"CurrentVersion"="5.1"', '"CurrentVersion"="10.0"')
    systemReg = systemReg.replace('"ProductName"="Microsoft Windows XP"', '"ProductName"="Microsoft Windows 10"')
    systemReg = systemReg.replace('"CSDVersion"=dword:00000300', '"CSDVersion"=dword:00000000')
    await writeFile(path.join(wineDir, "system.reg"), systemReg)

    // remove links to host OS
    const desktopDir = path.join(this.userDir, "Desktop")
    await BluebirdPromise.all([
      unlinkIfExists(desktopDir),
      unlinkIfExists(path.join(this.userDir, "My Documents")),
      unlinkIfExists(path.join(this.userDir, "My Music")),
      unlinkIfExists(path.join(this.userDir, "My Pictures")),
      unlinkIfExists(path.join(this.userDir, "My Videos")),
    ])

    await ensureDir(desktopDir)
    return env
  }
开发者ID:mbrainiac,项目名称:electron-builder,代码行数:32,代码来源:wine.ts


示例6: deleteOldElectronVersion

async function deleteOldElectronVersion(): Promise<any> {
  if (!process.env.CI) {
    return
  }

  const cacheDir = path.join(homedir(), ".electron")
  try {
    const deletePromises: Array<Promise<any>> = []
    for (let file of (await readdir(cacheDir))) {
      if (file.endsWith(".zip") && !file.includes(ELECTRON_VERSION)) {
        console.log(`Remove old electron ${file}`)
        deletePromises.push(unlink(path.join(cacheDir, file)))
      }
    }
    return await BluebirdPromise.all(deletePromises)
  }
  catch (e) {
    if (e.code === "ENOENT") {
      return []
    }
    else {
      throw e
    }
  }
}
开发者ID:aulvi,项目名称:electron-builder,代码行数:25,代码来源:runTests.ts


示例7: assertThat

    packed: async context => {
      const base = path.join(context.outDir, platform.buildConfigurationKey + `${platform === Platform.MAC ? "" : "-unpacked"}`)
      let resourcesDir = path.join(base, "resources")
      if (platform === Platform.MAC) {
        resourcesDir = path.join(base, "TestApp.app", "Contents", "Resources")
      }
      const appDir = path.join(resourcesDir, "app")

      await BluebirdPromise.all([
        assertThat(path.join(resourcesDir, "foo")).isDirectory(),
        assertThat(path.join(appDir, "foo")).doesNotExist(),

        assertThat(path.join(resourcesDir, "foo", "nameWithoutDot")).isFile(),
        assertThat(path.join(appDir, "foo", "nameWithoutDot")).doesNotExist(),

        assertThat(path.join(resourcesDir, "bar", "hello.txt")).isFile(),
        assertThat(path.join(resourcesDir, "bar", `${process.arch}.txt`)).isFile(),
        assertThat(path.join(appDir, "bar", `${process.arch}.txt`)).doesNotExist(),

        assertThat(path.join(resourcesDir, osName, `${process.arch}.txt`)).isFile(),
        assertThat(path.join(resourcesDir, "platformSpecificR")).isFile(),
        assertThat(path.join(resourcesDir, "ignoreMe.txt")).doesNotExist(),

        allCan(path.join(resourcesDir, "executable"), true),
        allCan(path.join(resourcesDir, "executableOnlyOwner"), true),

        allCan(path.join(resourcesDir, "bar", "hello.txt"), false),
      ])

      expect(await readFile(path.join(resourcesDir, "bar", "hello.txt"), "utf-8")).toEqual("data")
    },
开发者ID:heinzbeinz,项目名称:electron-builder,代码行数:31,代码来源:filesTest.ts


示例8: assertDirs

function assertDirs(context: PackedContext) {
  return BluebirdPromise.all([
    assertThat(path.join(context.getResources(Platform.LINUX), "app.asar.unpacked", "assets")).isDirectory(),
    assertThat(path.join(context.getResources(Platform.LINUX), "app.asar.unpacked", "b2")).isDirectory(),
    assertThat(path.join(context.getResources(Platform.LINUX), "app.asar.unpacked", "do-not-unpack-dir", "file.json")).isFile(),
    assertThat(path.join(context.getResources(Platform.LINUX), "app.asar.unpacked", "do-not-unpack-dir", "must-be-not-unpacked")).doesNotExist(),
    assertThat(path.join(context.getResources(Platform.LINUX), "app.asar.unpacked", "do-not-unpack-dir", "dir-2")).doesNotExist(),
  ])
}
开发者ID:mbrainiac,项目名称:electron-builder,代码行数:9,代码来源:globTest.ts


示例9: modifyPackageJson

 projectDirCreated: projectDir => {
   return BluebirdPromise.all([
     modifyPackageJson(projectDir, data => {
       data.main = "path/app.asar/index.js"
     }, true),
     modifyPackageJson(projectDir, data => {
       data.build.asar = false
     })
   ])
 }
开发者ID:heinzbeinz,项目名称:electron-builder,代码行数:10,代码来源:mainEntryTest.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript bluebird-lst-c.map函数代码示例发布时间:2022-05-25
下一篇:
TypeScript bluebird-lst.resolve函数代码示例发布时间: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