mirror of
https://github.com/ethauvin/bld.git
synced 2025-04-25 08:17:11 -07:00
More improvements to create operation
This commit is contained in:
parent
3d86aa8c8d
commit
2dd53ace3d
2 changed files with 9 additions and 3 deletions
2
core
2
core
|
@ -1 +1 @@
|
||||||
Subproject commit bf35e9888cb4cfa4316f8cfab78d19bff5ef1c29
|
Subproject commit 4f6c294b8b143293aa75e7c2925cd431f839343d
|
|
@ -393,17 +393,20 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
|
||||||
if (package_name == null || package_name.isBlank()) {
|
if (package_name == null || package_name.isBlank()) {
|
||||||
System.out.println("Please enter a package name (for instance: com.example):");
|
System.out.println("Please enter a package name (for instance: com.example):");
|
||||||
package_name = System.console().readLine();
|
package_name = System.console().readLine();
|
||||||
if (package_name == null || package_name.isEmpty()) {
|
if (package_name == null || package_name.isBlank()) {
|
||||||
throw new OperationOptionException("ERROR: package name is required.");
|
throw new OperationOptionException("ERROR: package name is required.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Using package name: " + package_name);
|
System.out.println("Using package name: " + package_name);
|
||||||
}
|
}
|
||||||
|
if (!ValidityChecks.checkJavaPackage(package_name)) {
|
||||||
|
throw new OperationOptionException("ERROR: package name is invalid.");
|
||||||
|
}
|
||||||
|
|
||||||
if (project_name == null || project_name.isBlank()) {
|
if (project_name == null || project_name.isBlank()) {
|
||||||
System.out.println("Please enter a project name (for instance: my-app):");
|
System.out.println("Please enter a project name (for instance: my-app):");
|
||||||
project_name = System.console().readLine();
|
project_name = System.console().readLine();
|
||||||
if (project_name == null || project_name.isEmpty()) {
|
if (project_name == null || project_name.isBlank()) {
|
||||||
throw new OperationOptionException("ERROR: project name is required.");
|
throw new OperationOptionException("ERROR: project name is required.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -421,6 +424,9 @@ public abstract class AbstractCreateOperation<T extends AbstractCreateOperation<
|
||||||
} else {
|
} else {
|
||||||
System.out.println("Using base name: " + base_name);
|
System.out.println("Using base name: " + base_name);
|
||||||
}
|
}
|
||||||
|
if (!ValidityChecks.checkJavaIdentifier(base_name)) {
|
||||||
|
throw new OperationOptionException("ERROR: base name is invalid.");
|
||||||
|
}
|
||||||
|
|
||||||
return workDirectory(new File(System.getProperty("user.dir")))
|
return workDirectory(new File(System.getProperty("user.dir")))
|
||||||
.packageName(package_name)
|
.packageName(package_name)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue