(git_dir, force_create=False)
| 29 | |
| 30 | |
| 31 | def create_git_dir(git_dir, force_create=False) -> None: |
| 32 | if os.path.exists(git_dir): |
| 33 | print(f"{git_dir} already exists! Do you want to remove it? (y/n)") |
| 34 | if force_create or input() == "y": |
| 35 | print(f"Removing {git_dir}...") |
| 36 | for filename in os.listdir(git_dir): |
| 37 | file_path = os.path.join(git_dir, filename) |
| 38 | if os.path.isfile(file_path): |
| 39 | os.remove(file_path) |
| 40 | elif os.path.isdir(file_path): |
| 41 | shutil.rmtree(file_path) |
| 42 | else: |
| 43 | raise ValueError(f"Unknown file type: {file_path}") |
| 44 | else: |
| 45 | print("Abort!") |
| 46 | exit() |
| 47 | else: |
| 48 | os.mkdir(git_dir, mode=0o755) |
| 49 | |
| 50 | |
| 51 | def delete_remote_branches(config: EvoGitConfig) -> None: |
nothing calls this directly
no outgoing calls
no test coverage detected