Skip to content

Commit 929a1f3

Browse files
committed
Trim new-service CLI inputs.
1 parent 5ae402b commit 929a1f3

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

release-scripts/src/main/java/software/amazon/awssdk/release/NewServiceMain.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
import org.w3c.dom.Document;
3737
import org.w3c.dom.Node;
3838
import software.amazon.awssdk.utils.Logger;
39-
import software.amazon.awssdk.utils.Validate;
4039

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

9897
private NewServiceCreator(CommandLine commandLine) {
99-
this.mavenProjectRoot = Paths.get(commandLine.getOptionValue("maven-project-root"));
100-
this.mavenProjectVersion = commandLine.getOptionValue("maven-project-version");
101-
this.serviceModuleName = commandLine.getOptionValue("service-module-name");
102-
this.serviceId = commandLine.getOptionValue("service-id");
103-
this.serviceProtocol = transformSpecialProtocols(commandLine.getOptionValue("service-protocol"));
98+
this.mavenProjectRoot = Paths.get(commandLine.getOptionValue("maven-project-root").trim());
99+
this.mavenProjectVersion = commandLine.getOptionValue("maven-project-version").trim();
100+
this.serviceModuleName = commandLine.getOptionValue("service-module-name").trim();
101+
this.serviceId = commandLine.getOptionValue("service-id").trim();
102+
this.serviceProtocol = transformSpecialProtocols(commandLine.getOptionValue("service-protocol").trim());
104103
}
105104

106105
private String transformSpecialProtocols(String protocol) {
@@ -113,8 +112,6 @@ private String transformSpecialProtocols(String protocol) {
113112
}
114113

115114
public void run() throws Exception {
116-
Validate.isTrue(Files.exists(mavenProjectRoot), "Project root does not exist: " + mavenProjectRoot);
117-
118115
Path servicesRoot = mavenProjectRoot.resolve("services");
119116
Path templateModulePath = servicesRoot.resolve("new-service-template");
120117
Path newServiceModulePath = servicesRoot.resolve(serviceModuleName);

0 commit comments

Comments
 (0)