mirror of
https://gitee.com/dcren/initializr.git
synced 2025-09-19 18:22:26 +08:00
Consistently create project directory
Closes gh-971
This commit is contained in:
@@ -47,14 +47,16 @@ public class DefaultProjectAssetGenerator implements ProjectAssetGenerator<Path>
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Path initializerProjectDirectory(Path rootDir, ResolvedProjectDescription description) throws IOException {
|
private Path initializerProjectDirectory(Path rootDir, ResolvedProjectDescription description) throws IOException {
|
||||||
|
Path projectDirectory = resolveProjectDirectory(rootDir, description);
|
||||||
|
Files.createDirectories(projectDirectory);
|
||||||
|
return projectDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Path resolveProjectDirectory(Path rootDir, ResolvedProjectDescription description) {
|
||||||
if (description.getBaseDirectory() != null) {
|
if (description.getBaseDirectory() != null) {
|
||||||
Path dir = rootDir.resolve(description.getBaseDirectory());
|
return rootDir.resolve(description.getBaseDirectory());
|
||||||
Files.createDirectories(dir);
|
|
||||||
return dir;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return rootDir;
|
|
||||||
}
|
}
|
||||||
|
return rootDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user