Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated README.md

  • Loading branch information...
commit 20a4cd671b2394dc64861a96febc739f6dd236a6 2 parents 2152f50 + eb71373
@sirrapa authored
View
5 src/main/java/com/sirrapa/maven/plugins/nodejs/NodeJsMojo.java
@@ -105,9 +105,12 @@ public void execute() throws MojoExecutionException {
* @return
*/
protected String getNodeJsExecutable(String osFamily) {
+ if(osFamily == null) {
+ throw new IllegalArgumentException("osFamily is null");
+ }
getLog().debug(String.format("Determing executable for osFamily = '%s'",osFamily));
StringBuilder sb = new StringBuilder(nodejsDirectory.getAbsolutePath());
- if (Os.FAMILY_WINDOWS.equals(osFamily) || Os.FAMILY_DOS.equals(osFamily)) {
+ if (osFamily.toLowerCase().startsWith("win")) {
sb.append(File.separator).append("node.exe");
} else {
sb.append(File.separator).append("bin").append(File.separator).append("node");
View
3  src/test/java/com/sirrapa/maven/plugins/nodejs/NodeJsMojoTest.java
@@ -174,11 +174,10 @@ public void testGetNodeJsExecutable() throws Exception {
String nodejsEx;
for (String family : Os.getValidFamilies()) {
- Os os = new Os(family);
nodejsEx = mojo.getNodeJsExecutable(family);
log.debug(String.format("nodejsEx for %s = %s", family, nodejsEx));
- if (Os.FAMILY_WINDOWS.equals(family) || Os.FAMILY_DOS.equals(family)) {
+ if (family.startsWith("win")) {
assertTrue(String.format("The nodejs executable for %s family is invalid", family), nodejsEx.endsWith(File.separator + "nodejs" + File.separator + "node.exe"));
} else {
assertTrue(String.format("The nodejs executable for %s family is invalid", family), nodejsEx.endsWith(File.separator + "nodejs" + File.separator + "bin" + File.separator + "node"));
Please sign in to comment.
Something went wrong with that request. Please try again.