Permalink
Browse files

FIX: generated start.bat uses invalid path separator #144

  • Loading branch information...
xhanin committed Jan 20, 2015
1 parent 62f734b commit 168ebfc139cb8e5e86275ad32bd8de7369d3e6e3
Showing with 9 additions and 9 deletions.
  1. +9 −9 restx-core-shell/src/main/java/restx/core/shell/AppShellCommand.java
@@ -511,24 +511,17 @@ public void run(RestxShell shell) throws Exception {
}
-
- String command = "java" +
- " -cp \"" + appSettings.targetClasses() + ":" + appSettings.targetDependency() + "/*\"" +
- " -Drestx.app.package=" + pack.get() +
- " -Drestx.mode=prod"
- ;
-
File startSh = shell.currentLocation().resolve("start.sh").toFile();
Files.write(
"#!/bin/sh\n\n" +
- command + " $VM_OPTIONS " +
+ getCommand(appSettings, pack, ":") + " $VM_OPTIONS " +
" " + appClassName + "\n",
startSh, Charsets.UTF_8);
startSh.setExecutable(true);
File startBat = shell.currentLocation().resolve("start.bat").toFile();
Files.write(
- command + " %VM_OPTIONS% " +
+ getCommand(appSettings, pack, ";") + " %VM_OPTIONS% " +
" " + appClassName + "\r\n",
startBat, Charsets.ISO_8859_1);
@@ -537,6 +530,13 @@ public void run(RestxShell shell) throws Exception {
"\t" + startBat.getAbsolutePath() + "\n",
RestxShell.AnsiCodes.ANSI_GREEN);
}
+
+ protected String getCommand(AppSettings appSettings, Optional<String> pack, String pathSeparator) {
+ return "java" +
+ " -cp \"" + appSettings.targetClasses() + pathSeparator + appSettings.targetDependency() + "/*\"" +
+ " -Drestx.app.package=" + pack.get() +
+ " -Drestx.mode=prod";
+ }
}
private class RunAppCommandRunner implements ShellCommandRunner {

0 comments on commit 168ebfc

Please sign in to comment.