Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fix Sonar complaint #10902

Merged
merged 1 commit into from
May 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -302,19 +302,24 @@ private JsonObject readGeneratedDevDependencies(String path)
}

private boolean shouldRunNpmInstall() {
if (packageUpdater.nodeModulesFolder.isDirectory()) {
// Ignore .bin and pnpm folders as those are always installed for
// pnpm execution
File[] installedPackages = packageUpdater.nodeModulesFolder
.listFiles(
(dir, name) -> !ignoredNodeFolders.contains(name));
assert installedPackages != null;
return installedPackages.length == 0
|| (installedPackages.length == 1 && FLOW_NPM_PACKAGE_NAME
.startsWith(installedPackages[0].getName()))
|| (installedPackages.length > 0 && isVaadinHashUpdated());
if (!packageUpdater.nodeModulesFolder.isDirectory()) {
return true;
}
// Ignore .bin and pnpm folders as those are always installed for
// pnpm execution
File[] installedPackages = packageUpdater.nodeModulesFolder
.listFiles((dir, name) -> !ignoredNodeFolders.contains(name));
assert installedPackages != null;
if (installedPackages.length == 0) {
// Nothing installed
return true;
} else if (installedPackages.length == 1 && FLOW_NPM_PACKAGE_NAME
.startsWith(installedPackages[0].getName())) {
// Only flow-frontend installed
return true;
} else {
return isVaadinHashUpdated();
}
return true;
}

private boolean isVaadinHashUpdated() {
Expand Down