Skip to content

Commit

Permalink
FIX: generated start.bat uses invalid path separator #144
Browse files Browse the repository at this point in the history
  • Loading branch information
xhanin committed Jan 20, 2015
1 parent 62f734b commit 168ebfc
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 {
Expand Down

0 comments on commit 168ebfc

Please sign in to comment.