Skip to content

Commit

Permalink
DCA11Y-1145: handle empty node version
Browse files Browse the repository at this point in the history
  • Loading branch information
flipatlas committed Sep 30, 2024
1 parent d65fdf0 commit 5c58f3b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import com.github.eirslett.maven.plugins.frontend.lib.version.manager.VersionManagerCache;
import com.github.eirslett.maven.plugins.frontend.lib.version.manager.VersionManagerRunner;
import jdk.internal.joptsimple.internal.Strings;
import org.apache.commons.io.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -118,12 +119,12 @@ public void install() throws InstallationException {

private void verifyNodeVersion() throws InstallationException {
if (this.versionManagerCache.isVersionManagerAvailable()) {
if (this.nodeVersion != null) {
if (!Strings.isNullOrEmpty(this.nodeVersion)) {
logger.warn("`nodeVersion` has been configured to {} but will be ignored." +
" Version Manager will load the version from their version file (e.g. .nvmrc, .tool-versions)", this.nodeVersion);
}
} else {
if (this.nodeVersion == null) {
if (Strings.isNullOrEmpty(this.nodeVersion)) {
throw new InstallationException("`nodeVersion` needs to be provided when running node installation without node version manager.");
}
}
Expand Down

0 comments on commit 5c58f3b

Please sign in to comment.