Skip to content

Commit

Permalink
Fixed RunOption args parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Aug 20, 2023
1 parent 912ba87 commit c635b25
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/main/java/rife/bld/operations/RunOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,22 @@ protected List<String> executeConstructProcessCommandList() {
*/
public RunOperation fromProject(BaseProject project) {
var operation = workDirectory(project.workDirectory())
.javaTool(project.javaTool())
.classpath(project.runClasspath())
.mainClass(project.mainClass());
.javaTool(project.javaTool())
.classpath(project.runClasspath())
.mainClass(project.mainClass());
if (project.usesRife2Agent()) {
operation.javaOptions().javaAgent(project.getRife2AgentFile());
}

// parse the run arguments if any
var args = project.arguments();
while (!args.isEmpty()) {
if (!args.isEmpty()) {
var arg = args.get(0);
if (arg.startsWith("-")) {
if (arg.startsWith(ARGS_OPTION)) {
args.remove(0);
if (arg.startsWith(ARGS_OPTION)) {
var runArgs = arg.substring(ARGS_OPTION.length());
if (!runArgs.isBlank()) {
runOptions_.addAll(0, Arrays.asList(runArgs.split(" ")));
}
var runArgs = arg.substring(ARGS_OPTION.length());
if (!runArgs.isBlank()) {
runOptions_.addAll(0, Arrays.asList(runArgs.split(" ")));
}
}
}
Expand Down

0 comments on commit c635b25

Please sign in to comment.