Skip to content

Commit

Permalink
fix(app-builder-lib): yarn install break on 'electron-builder install…
Browse files Browse the repository at this point in the history
…-app-deps' when used pnp (#4147)

Plug’n’Play https://yarnpkg.com/en/docs/pnp
  • Loading branch information
true0r authored and develar committed Sep 23, 2019
1 parent fc85a42 commit 0fe8f12
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/app-builder-lib/src/util/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ export async function installOrRebuild(config: Configuration, appDir: string, op
buildFromSource: config.buildDependenciesFromSource === true,
additionalArgs: asArray(config.npmArgs), ...options
}
let isDependenciesInstalled = false

if (forceInstall || !(await pathExists(path.join(appDir, "node_modules")))) {
for (const fileOrDir of ["node_modules", ".pnp.js"]) {
if (await pathExists(path.join(appDir, fileOrDir))) {
isDependenciesInstalled = true

break
}
}

if (forceInstall || !isDependenciesInstalled) {
await installDependencies(appDir, effectiveOptions)
}
else {
Expand Down

0 comments on commit 0fe8f12

Please sign in to comment.