Skip to content

Commit

Permalink
Use "-" in generated root project name instead of spaces
Browse files Browse the repository at this point in the history
- part of #15655

Signed-off-by: Reinhold Degenfellner <rdegenfellner@gradle.com>
  • Loading branch information
reinsch82 committed Jan 25, 2023
1 parent 5143dd5 commit 7350715
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public DefaultSettings(
private static String getProjectName(File settingsDir) {
if(contains(File.listRoots(), settingsDir)) {
String rootIndicator = settingsDir.toPath().getRoot().toString().replaceAll("[\\\\:\\/]*", "");
return "generated " + rootIndicator + (rootIndicator.isEmpty() ? "" : " ") +
return "generated-" + rootIndicator + (rootIndicator.isEmpty() ? "" : "-") +
sha512().hashString(now().toString()).toString().substring(0, 6);
}
return settingsDir.getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ class DefaultSettingsRootFileSystemTest extends DefaultSettingsCommonTest {

private getRootProjectNamePattern() {
if(OperatingSystem.current().isWindows()) {
return 'generated [a-zA-Z] [a-z0-9]{6}'
return 'generated-[a-zA-Z]-[a-z0-9]{6}'
}
return 'generated [a-z0-9]{6}'

return 'generated-[a-z0-9]{6}'
}

}

0 comments on commit 7350715

Please sign in to comment.