Skip to content

Commit

Permalink
Fix mvnd command line aliases, fixes #490
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 6, 2021
1 parent 08480db commit dff50ac
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions client/src/main/java/org/mvndaemon/mvnd/client/DefaultClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,23 @@ public ExecutionResult execute(ClientOutput output, List<String> argv) {
return DefaultResult.success(argv);
}

if (!Environment.MVND_THREADS.hasCommandLineOption(args)) {
Environment.MVND_THREADS.addCommandLineOption(args, parameters.threads());
}
if (!Environment.MVND_BUILDER.hasCommandLineOption(args)) {
Environment.MVND_BUILDER.addCommandLineOption(args, parameters.builder());
}
Environment.MVND_THREADS.removeCommandLineOption(args);
Environment.MVND_THREADS.addCommandLineOption(args, parameters.threads());

Environment.MVND_BUILDER.removeCommandLineOption(args);
Environment.MVND_BUILDER.addCommandLineOption(args, parameters.builder());

final Path settings = parameters.settings();
if (settings != null && !Environment.MAVEN_SETTINGS.hasCommandLineOption(args)) {
if (settings != null) {
Environment.MAVEN_SETTINGS.removeCommandLineOption(args);
Environment.MAVEN_SETTINGS.addCommandLineOption(args, settings.toString());
}

final Path localMavenRepository = parameters.mavenRepoLocal();
if (localMavenRepository != null && !Environment.MAVEN_REPO_LOCAL.hasCommandLineOption(args)) {
Environment.MAVEN_REPO_LOCAL.addCommandLineOption(args, localMavenRepository.toString());
}

Environment.MVND_TERMINAL_WIDTH.addCommandLineOption(args, Integer.toString(output.getTerminalWidth()));

Path dir;
Expand Down

0 comments on commit dff50ac

Please sign in to comment.