本文整理汇总了TypeScript中electron-builder-util/out/fs.exists函数的典型用法代码示例。如果您正苦于以下问题:TypeScript exists函数的具体用法?TypeScript exists怎么用?TypeScript exists使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了exists函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: installOrRebuild
export async function installOrRebuild(config: Config, appDir: string, electronVersion: string, platform: string, arch: string, forceInstall: boolean = false) {
const args = asArray(config.npmArgs)
if (forceInstall || !(await exists(path.join(appDir, "node_modules")))) {
await installDependencies(appDir, electronVersion, platform, arch, args, !config.npmSkipBuildFromSource)
}
else {
await rebuild(appDir, electronVersion, platform, arch, args, !config.npmSkipBuildFromSource)
}
}
示例2: installOrRebuild
export async function installOrRebuild(config: Config, appDir: string, options: RebuildOptions, forceInstall: boolean = false) {
const effectiveOptions = {
buildFromSource: config.buildDependenciesFromSource === true,
additionalArgs: asArray(config.npmArgs), ...options
}
if (forceInstall || !(await exists(path.join(appDir, "node_modules")))) {
await installDependencies(appDir, effectiveOptions)
}
else {
await rebuild(appDir, effectiveOptions)
}
}
示例3: exists
const nativeDeps = await BluebirdPromise.filter(pathToDep.values(), it => it.extraneous ? false : exists(path.join(it.path, "binding.gyp")), {concurrency: 8})
示例4: exists
const nativeDeps = await BluebirdPromise.filter(await options.productionDeps!.value, it => exists(path.join(it.path, "binding.gyp")), {concurrency: 8})
示例5: doesNotExist
async doesNotExist() {
if (await exists(this.actual)) {
throw new Error(`Path ${this.actual} must not exist`)
}
}