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

Spaces in path names #19

Open
dwward opened this issue Apr 11, 2013 · 1 comment
Open

Spaces in path names #19

dwward opened this issue Apr 11, 2013 · 1 comment

Comments

@dwward
Copy link

dwward commented Apr 11, 2013

Hi, I am using your plugin and it is not handling spaces with path names when running nodejs. I was using the filtered-build mechanism and I am unable to control the double quotes properly. This was causing me a problem in my CI environment which resides under "C:\Program Files...." I was able to work around this by pulling the plugin and making changes to executeScript(...) method. I used the expanded form of CommandLine.

Could something like this be included in a future release? I just joined GitHub about 10 minutes ago and I'm still learning how this all works.

NodeJsRunner.java

  private boolean executeScript(String nodeJsFile, String scriptName, String[] params) throws IOException {
    String optimizeFlag = params[0];
    String targetFile = params[1];

    Map<String, File> substitutionMap = new HashMap<String, File>();
    substitutionMap.put("scriptName",  new File(scriptName));
    substitutionMap.put("targetFile",  new File(targetFile));

    CommandLine cmdLine = new CommandLine(nodeJsFile);
    cmdLine.addArgument("${scriptName}");
    cmdLine.addArgument(optimizeFlag);
    cmdLine.addArgument("${targetFile}");
    cmdLine.setSubstitutionMap(substitutionMap);

    DefaultExecutor executor = new DefaultExecutor();
    try {
      return executor.execute(cmdLine) == 0;
    } catch (ExecuteException e) {
      return e.getExitValue() == 0;
    }
  }
@MattCheely
Copy link
Owner

Hello, and welcome to github! I have pushed a new version which I think should resolve your issue. You can build it from source, or you should be able to update your project's version of the plugin to 2.0.0-SNAPSHOT, in which case you will need to add the sonatype snapshot repository to your pom, by adding the tags below to the project config

<repositories>
    <repository>
      <id>sonatype-snapshot</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </repository>
 </repositories>

If you can try it out and let me know if it works for you, I would greatly appreciate it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants