本文整理匯總了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`)
}
}