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


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

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


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

示例1: isSignAllowed

export function isSignAllowed(isPrintWarn = true): boolean {
  if (process.platform !== "darwin") {
    if (isPrintWarn) {
      warn("macOS application code signing is supported only on macOS, skipping.")
    }
    return false
  }

  const buildForPrWarning = "There are serious security concerns with CSC_FOR_PULL_REQUEST=true (see the  CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)" +
    "\nIf you have SSH keys, sensitive env vars or AWS credentials stored in your project settings and untrusted forks can make pull requests against your repo, then this option isn't for you."

  if (isPullRequest()) {
    if (isEnvTrue(process.env.CSC_FOR_PULL_REQUEST)) {
      if (isPrintWarn) {
        warn(buildForPrWarning)
      }
    }
    else {
      if (isPrintWarn) {
        // https://github.com/electron-userland/electron-builder/issues/1524
        warn("Current build is a part of pull request, code signing will be skipped." +
          "\nSet env CSC_FOR_PULL_REQUEST to true to force code signing." +
          `\n${buildForPrWarning}`)
      }
      return false
    }
  }
  return true
}
开发者ID:jwheare,项目名称:electron-builder,代码行数:29,代码来源:codeSign.ts

示例2: unpack

async function unpack(packager: PlatformPackager<any>, out: string, platform: string, options: InternalElectronDownloadOptions) {
  let dist: string | null | undefined = packager.config.electronDist
  if (dist != null) {
    const zipFile = `electron-v${options.version}-${platform}-${options.arch}.zip`
    const resolvedDist = path.resolve(packager.projectDir, dist)
    if ((await statOrNull(path.join(resolvedDist, zipFile))) != null) {
      options.cache = resolvedDist
      dist = null
    }
  }

  if (dist == null) {
    const zipPath = (await BluebirdPromise.all<any>([
      packager.info.electronDownloader(options),
      emptyDir(out)
    ]))[0]

    if (process.platform === "darwin" || isEnvTrue(process.env.USE_UNZIP)) {
      // on mac unzip faster than 7za (1.1 sec vs 1.6 see)
      await exec("unzip", ["-oqq", "-d", out, zipPath])
    }
    else {
      await spawn(path7za, debug7zArgs("x").concat(zipPath, "-aoa", `-o${out}`))
      if (platform === "linux") {
        // https://github.com/electron-userland/electron-builder/issues/786
        // fix dir permissions — opposite to extract-zip, 7za creates dir with no-access for other users, but dir must be readable for non-root users
        await BluebirdPromise.all([
          chmod(path.join(out, "locales"), "0755"),
          chmod(path.join(out, "resources"), "0755")
        ])
      }
    }
  }
  else {
    const source = packager.getElectronSrcDir(dist)
    const destination = packager.getElectronDestinationDir(out)
    log.info({source, destination}, "copying Electron")
    await emptyDir(out)
    await copyDir(source, destination, {
      isUseHardLink: DO_NOT_USE_HARD_LINKS,
    })
  }
}
开发者ID:ledinhphuong,项目名称:electron-builder,代码行数:43,代码来源:dirPackager.ts

示例3: copyTestAsset

    await BluebirdPromise.map(["BadgeLogo.scale-100.png", "BadgeLogo.scale-140.png", "BadgeLogo.scale-180.png"], name => copyTestAsset(`appx-assets/${name}`, path.join(targetDir, name)))
  },
  signedWin: true,
}))

it.ifDevOrWinCi("auto launch", app({
  targets: Platform.WINDOWS.createTarget(["appx"], Arch.x64),
  config: {
    appx: {
      addAutoLaunchExtension: true,
    },
  },
}, {
}))

const it2 = isEnvTrue(process.env.DO_APPX_CERT_STORE_AWARE_TEST) ? test : test.skip
it2.ifNotCi("certificateSubjectName", app({
  targets: Platform.WINDOWS.createTarget(["appx"], Arch.x64),
  config: {
    win: {
      certificateSubjectName: "Foo",
    }
  },
}))

// todo - check manifest
it("languages and not signed (windows store only)", app({
  targets: Platform.WINDOWS.createTarget(["appx"], Arch.ia32, Arch.x64),
  config: {
    cscLink: protectedCscLink,
    cscKeyPassword: "test",
开发者ID:electron-userland,项目名称:electron-builder,代码行数:31,代码来源:appxTest.ts

示例4: isBuildCacheEnabled

export function isBuildCacheEnabled() {
  return !isEnvTrue(process.env.ELECTRON_BUILDER_DISABLE_BUILD_CACHE)
}
开发者ID:electron-userland,项目名称:electron-builder,代码行数:3,代码来源:flags.ts

示例5: isUseSystemSigncode

export function isUseSystemSigncode() {
  return isEnvTrue(process.env.USE_SYSTEM_SIGNCODE)
}
开发者ID:electron-userland,项目名称:electron-builder,代码行数:3,代码来源:flags.ts


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