當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript fs-extra-p.move函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。