@@ -89,7 +89,7 @@ def init_argparse():
89
89
parser .add_argument ('--new-project-name' , action = 'store' ,
90
90
default = get_octopusvariable_quiet (
91
91
'ForkGithubRepo.Exported.Project.Name' ) or get_octopusvariable_quiet (
92
- 'Exported.Project.Name' ) or get_octopusvariable_quiet ( 'Octopus.Project.Name' ) )
92
+ 'Exported.Project.Name' ))
93
93
parser .add_argument ('--github-app-id' , action = 'store' ,
94
94
default = get_octopusvariable_quiet (
95
95
'ForkGithubRepo.GitHub.App.Id' ) or get_octopusvariable_quiet ('GitHub.App.Id' ))
@@ -310,7 +310,8 @@ def ensure_git_exists():
310
310
template_repo = parser .template_repo_name .strip ()
311
311
new_repo_custom_prefix = re .sub ('[^a-zA-Z0-9]' , '_' , parser .new_repo_name_prefix .strip ())
312
312
tenant_name_sanitized = re .sub ('[^a-zA-Z0-9]' , '_' , parser .tenant_name .strip ())
313
- project_name_sanitized = re .sub ('[^a-zA-Z0-9]' , '_' , parser .new_project_name .strip ())
313
+ project_name_sanitized = re .sub ('[^a-zA-Z0-9]' , '_' ,
314
+ parser .new_project_name .strip () if parser .new_project_name .strip () else template_repo )
314
315
315
316
# The new repo is prefixed either with the custom prefix or the tenant name if no custom prefix is defined
316
317
new_repo_prefix = new_repo_custom_prefix if len (new_repo_custom_prefix ) != 0 else tenant_name_sanitized
0 commit comments