Skip to content

Trim new-service CLI inputs. #924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import software.amazon.awssdk.utils.Logger;
import software.amazon.awssdk.utils.Validate;

/**
* A command line application to create a new, empty service.
Expand Down Expand Up @@ -96,11 +95,11 @@ private static class NewServiceCreator {
private final String serviceProtocol;

private NewServiceCreator(CommandLine commandLine) {
this.mavenProjectRoot = Paths.get(commandLine.getOptionValue("maven-project-root"));
this.mavenProjectVersion = commandLine.getOptionValue("maven-project-version");
this.serviceModuleName = commandLine.getOptionValue("service-module-name");
this.serviceId = commandLine.getOptionValue("service-id");
this.serviceProtocol = transformSpecialProtocols(commandLine.getOptionValue("service-protocol"));
this.mavenProjectRoot = Paths.get(commandLine.getOptionValue("maven-project-root").trim());
this.mavenProjectVersion = commandLine.getOptionValue("maven-project-version").trim();
this.serviceModuleName = commandLine.getOptionValue("service-module-name").trim();
this.serviceId = commandLine.getOptionValue("service-id").trim();
this.serviceProtocol = transformSpecialProtocols(commandLine.getOptionValue("service-protocol").trim());
}

private String transformSpecialProtocols(String protocol) {
Expand All @@ -113,8 +112,6 @@ private String transformSpecialProtocols(String protocol) {
}

public void run() throws Exception {
Validate.isTrue(Files.exists(mavenProjectRoot), "Project root does not exist: " + mavenProjectRoot);

Path servicesRoot = mavenProjectRoot.resolve("services");
Path templateModulePath = servicesRoot.resolve("new-service-template");
Path newServiceModulePath = servicesRoot.resolve(serviceModuleName);
Expand Down