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

TypeScript fs-extra-p.move函数代码示例

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

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



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

示例1: async

test.ifAll.ifDevOrWinCi("web installer", async () => {
  let outDirs: Array<string> = []

  async function buildApp(version: string, tmpDir: TmpDir) {
    await assertPack("test-app-one", {
      targets: Platform.WINDOWS.createTarget(["nsis-web"], Arch.x64),
      config: {
        extraMetadata: {
          version,
        },
        // package in any case compressed, customization is explicitly disabled - "do not allow to change compression level to avoid different packages"
        compression: process.env.COMPRESSION as any || "store",
        publish: {
          provider: "s3",
          bucket: "develar",
          path: "test",
        },
      },
    }, {
      signedWin: true,
      packed: async context => {
        outDirs.push(context.outDir)
      },
      tmpDir,
    })
  }

  if (process.env.__SKIP_BUILD == null) {
    const tmpDir = new TmpDir("differential-updater-test")
    try {
      await buildApp(OLD_VERSION_NUMBER, tmpDir)
      // move dist temporarily out of project dir
      const oldDir = await tmpDir.getTempDir()
      await move(outDirs[0], oldDir)
      outDirs[0] = oldDir

      await buildApp("1.0.1", tmpDir)
    }
    catch (e) {
      await tmpDir.cleanup()
      throw e
    }

    // move old dist to new project as oldDist - simplify development (no need to guess where old dist located in the temp fs)
    const oldDir = path.join(outDirs[1], "..", "oldDist")
    await move(outDirs[0], oldDir)
    outDirs[0] = oldDir

    await move(path.join(oldDir, "nsis-web", `TestApp-${OLD_VERSION_NUMBER}-x64.nsis.7z`), path.join(getTestUpdaterCacheDir(oldDir), testAppCacheDirName, "package.7z"))
  }
  else {
    nsisWebDifferentialUpdateTestFakeSnapshot()
    outDirs = [
      path.join(process.env.TEST_APP_TMP_DIR!!, "oldDist"),
      path.join(process.env.TEST_APP_TMP_DIR!!, "dist"),
    ]
  }

  await testBlockMap(outDirs[0], path.join(outDirs[1], "nsis-web"), NsisUpdater, "win-unpacked", Platform.WINDOWS)
})
开发者ID:electron-userland,项目名称:electron-builder,代码行数:60,代码来源:differentialUpdateTest.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

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

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

    const unpackedDir = path.join(outDir, `win${arch === "x64" ? "" : `-${arch}`}-unpacked`)
    const finalAppOut = path.join(unpackedDir, "lib", "net45")
    const installerOut = computeDistOut(outDir, arch)
    log("Removing %s and %s", path.relative(this.projectDir, installerOut), path.relative(this.projectDir, unpackedDir))
    await BluebirdPromise.all([
      this.packApp(packOptions, appOutDir),
      emptyDir(installerOut),
      emptyDir(unpackedDir)
    ])

    await move(appOutDir, finalAppOut)
    appOutDir = finalAppOut

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


示例3: modifyPackageJson

 tempDirCreated: projectDir => BluebirdPromise.all([
   modifyPackageJson(projectDir, data => {
     data.directories = {
       buildResources: "custom"
     }
   }),
   move(path.join(projectDir, "build"), path.join(projectDir, "custom"))
 ])
开发者ID:MatthijsvandenBosch,项目名称:electron-builder,代码行数:8,代码来源:BuildTest.ts


示例4: move

 tempDirCreated: projectDir => BluebirdPromise.all([
   move(path.join(projectDir, "build", "icon.ico"), path.join(projectDir, "customIcon.ico")),
   modifyPackageJson(projectDir, data => {
     data.build.win = {
       icon: "customIcon"
     }
   })
 ]),
开发者ID:demetris-manikas,项目名称:electron-builder,代码行数:8,代码来源:winPackagerTest.ts


示例5: move

 tempDirCreated: projectDir => BluebirdPromise.all([
   move(path.join(projectDir, "build", "background.png"), path.join(projectDir, customBackground)),
   modifyPackageJson(projectDir, data => {
     data.build.osx = {
       background: customBackground,
       icon: "foo.icns",
     }
   })
 ]),
开发者ID:sethlu,项目名称:electron-builder,代码行数:9,代码来源:osxPackagerTest.ts


示例6: assertPack

 await assertPack("test-app-one", allPlatformsAndCurrentArch(), true, (projectDir) => {
   return BluebirdPromise.all([
     modifyPackageJson(projectDir, data => {
       data.directories = {
         buildResources: "custom"
       }
     }),
     move(path.join(projectDir, "build"), path.join(projectDir, "custom"))
   ])
 })
开发者ID:EvgeneOskin,项目名称:electron-builder,代码行数:10,代码来源:BuildTest.ts


示例7: move

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


示例8: doBuild

async function doBuild(outDirs: Array<string>, targets: Map<Platform, Map<Arch, Array<string>>>, tmpDir: TmpDir, extraConfig?: Configuration | null) {
  await buildApp("1.0.0", outDirs, targets, tmpDir, extraConfig)
  try {
    // move dist temporarily out of project dir
    const oldDir = await tmpDir.getTempDir()
    await move(outDirs[0], oldDir)
    outDirs[0] = oldDir

    await buildApp("1.0.1", outDirs, targets, tmpDir, extraConfig)
  }
  catch (e) {
    await tmpDir.cleanup()
    throw e
  }

  // move old dist to new project as oldDist - simplify development (no need to guess where old dist located in the temp fs)
  const oldDir = path.join(outDirs[1], "..", "oldDist")
  await move(outDirs[0], oldDir)
  outDirs[0] = oldDir
}
开发者ID:electron-userland,项目名称:electron-builder,代码行数:20,代码来源:differentialUpdateTest.ts


示例9: async

  }, true, async (projectDir) => {
    const file = path.join(projectDir, "package.json")
    const data = await readJson(file)
    data.directories = {
      buildResources: "custom"
    }

    return await BluebirdPromise.all([
      writeJson(file, data),
      move(path.join(projectDir, "build"), path.join(projectDir, "custom"))
    ])
  })
开发者ID:TakT,项目名称:electron-builder,代码行数:12,代码来源:BuildTest.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript fs-extra-p.open函数代码示例发布时间:2022-05-25
下一篇:
TypeScript fs-extra-p.mkdirs函数代码示例发布时间: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