Skip to content

Commit 168ebfc

Browse files
committed
FIX: generated start.bat uses invalid path separator #144
1 parent 62f734b commit 168ebfc

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

restx-core-shell/src/main/java/restx/core/shell/AppShellCommand.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -511,24 +511,17 @@ public void run(RestxShell shell) throws Exception {
511511
}
512512

513513

514-
515-
String command = "java" +
516-
" -cp \"" + appSettings.targetClasses() + ":" + appSettings.targetDependency() + "/*\"" +
517-
" -Drestx.app.package=" + pack.get() +
518-
" -Drestx.mode=prod"
519-
;
520-
521514
File startSh = shell.currentLocation().resolve("start.sh").toFile();
522515
Files.write(
523516
"#!/bin/sh\n\n" +
524-
command + " $VM_OPTIONS " +
517+
getCommand(appSettings, pack, ":") + " $VM_OPTIONS " +
525518
" " + appClassName + "\n",
526519
startSh, Charsets.UTF_8);
527520
startSh.setExecutable(true);
528521

529522
File startBat = shell.currentLocation().resolve("start.bat").toFile();
530523
Files.write(
531-
command + " %VM_OPTIONS% " +
524+
getCommand(appSettings, pack, ";") + " %VM_OPTIONS% " +
532525
" " + appClassName + "\r\n",
533526
startBat, Charsets.ISO_8859_1);
534527

@@ -537,6 +530,13 @@ public void run(RestxShell shell) throws Exception {
537530
"\t" + startBat.getAbsolutePath() + "\n",
538531
RestxShell.AnsiCodes.ANSI_GREEN);
539532
}
533+
534+
protected String getCommand(AppSettings appSettings, Optional<String> pack, String pathSeparator) {
535+
return "java" +
536+
" -cp \"" + appSettings.targetClasses() + pathSeparator + appSettings.targetDependency() + "/*\"" +
537+
" -Drestx.app.package=" + pack.get() +
538+
" -Drestx.mode=prod";
539+
}
540540
}
541541

542542
private class RunAppCommandRunner implements ShellCommandRunner {

0 commit comments

Comments
 (0)