Skip to content
Snippets Groups Projects
Commit cfa0efb4 authored by Ronald Jäpel's avatar Ronald Jäpel
Browse files

Fix bug in initialize repo is repo folder exists but is empty

parent 678d969d
No related branches found
No related tags found
No related merge requests found
......@@ -116,7 +116,7 @@ def initialize_git_repo(path_to_repo: str, output_repo_name: (str | bool) = "out
if path_to_repo != ".":
if os.path.exists(path_to_repo) and len(os.listdir(path_to_repo)) > 0:
raise ValueError("Path to repository already exists and is not an empty directory.")
os.makedirs(path_to_repo)
os.makedirs(path_to_repo, exist_ok=True)
os.chdir(path_to_repo)
os.system(f"git init")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment