Skip to content

Commit caaa192

Browse files
committed
Add directory name where the code is cloned to to the output
1 parent ba34ad7 commit caaa192

4 files changed

Lines changed: 12 additions & 14 deletions

File tree

autogit/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""autogit is a command line tool for updating multiple GitLab or GitHub repositories with a single command."""
22

3-
__version__ = '0.0.20'
3+
__version__ = '0.0.21'

autogit/actions/clone_repositories.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ async def clone_repository(repo: RepoState) -> None:
6767

6868

6969
def print_cloned_repositories(repos):
70-
print()
71-
print('\033[1;34m|' + 'Cloned repositories'.center(77, '-') + '|\033[0m')
70+
clone_to = next(iter(repos.values())).args.clone_to
71+
print('\n\033[1;34m|' + f'Cloned repositories (to {clone_to})'.center(77, '-') + '|\033[0m')
7272
should_print_not_cloned_repos = False
7373
for repo in repos.values():
7474
if repo.cloning_state == CloningStates.CLONED.value:
75-
print(f'\033[1;34m|\033[0m - {repo.url.ljust(73, " ")} \033[1;34m|\033[0m')
75+
print(f'\033[1;34m|\033[0m {repo.url.ljust(73, " ")} \033[1;34m|\033[0m')
7676
else:
7777
should_print_not_cloned_repos = True
7878
if should_print_not_cloned_repos:
@@ -84,7 +84,7 @@ def print_cloned_repositories(repos):
8484
for repo in repos.values():
8585
if repo.cloning_state != repo.cloning_state:
8686
print(
87-
f'\033[1;34m|\033[0m - {(repo.url + " " + CloningStates.CLONED.value).ljust(73, " ")} \033[1;34m|\033[0m'
87+
f'\033[1;34m|\033[0m {(repo.url + " " + CloningStates.CLONED.value).ljust(73, " ")} \033[1;34m|\033[0m'
8888
)
8989
print('\033[1;34m|' + ''.center(77, '-') + '|\033[0m')
9090

autogit/actions/commit_and_push_changes.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,13 @@ async def commit_and_push_changes(repo: RepoState) -> None:
1919

2020

2121
def print_modified_repositories(repos: dict[str, RepoState]):
22-
print()
2322
branch = next(iter(repos.values())).branch
24-
print('\033[1;34m|' + f'Created branch: {branch}'.center(77, '-') + '|\033[0m')
23+
print('\n\033[1;34m|' + f'Created branch: {branch}'.center(77, '-') + '|\033[0m')
2524
should_print_not_modified_repos = False
2625
print_repo_exceptions = False
2726
for repo in repos.values():
2827
if repo.modification_state == ModificationState.PUSHED_TO_REMOTE.value:
29-
print(f'\033[1;34m|\033[0m - {repo.url.ljust(73, " ")} \033[1;34m|\033[0m')
28+
print(f'\033[1;34m|\033[0m {repo.url.ljust(73, " ")} \033[1;34m|\033[0m')
3029
else:
3130
if repo.modification_state == ModificationState.GOT_EXCEPTION.value:
3231
print_repo_exceptions = True
@@ -41,7 +40,7 @@ def print_modified_repositories(repos: dict[str, RepoState]):
4140
for repo in repos.values():
4241
if repo.cloning_state != ModificationState.PUSHED_TO_REMOTE.value:
4342
print(
44-
f'\033[1;34m|\033[0m - {(repo.url + " " + repo.modification_state).ljust(73, " ")} \033[1;34m|\033[0m'
43+
f'\033[1;34m|\033[0m {(repo.url + " " + repo.modification_state).ljust(73, " ")} \033[1;34m|\033[0m'
4544
)
4645

4746
if print_repo_exceptions:
@@ -52,7 +51,7 @@ def print_modified_repositories(repos: dict[str, RepoState]):
5251
if repo.cloning_state == ModificationState.GOT_EXCEPTION.value:
5352
print(
5453
'\033[1;34m|\033[0m'
55-
f' - {(repo.url + " " + repo.modification_state).ljust(73, " ")}:'
54+
f' {(repo.url + " " + repo.modification_state).ljust(73, " ")}:'
5655
'\033[1;34m|\033[0m'
5756
)
5857
print(repo.stderr)

autogit/actions/create_pull_request.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,12 @@ def get_http_request_params_for_pull_request_creation(
4747

4848

4949
def print_pull_requests(repos):
50-
print()
51-
print('\033[1;34m|' + 'Created Pull Requests'.center(77, '-') + '|\033[0m')
50+
print('\n\033[1;34m|' + 'Created Pull Requests'.center(77, '-') + '|\033[0m')
5251
show_not_created_pull_requests = False
5352
for repo in repos.values():
5453
if repo.pull_request_state == PullRequestStates.CREATED.value:
5554
print(
56-
f'\033[1;34m|\033[0m - {repo.pull_request_url.ljust(73, " ")} \033[1;34m|\033[0m'
55+
f'\033[1;34m|\033[0m {repo.pull_request_url.ljust(73, " ")} \033[1;34m|\033[0m'
5756
)
5857
else:
5958
show_not_created_pull_requests = True
@@ -62,7 +61,7 @@ def print_pull_requests(repos):
6261
for repo in repos.values():
6362
if repo.pull_request_state == PullRequestStates.GOT_BAD_RESPONSE.value:
6463
print(
65-
f'\033[1;34m|\033[0m - {repo.url.ljust(73, " ")} \033[1;34m|\033[0m'
64+
f'\033[1;34m|\033[0m {repo.url.ljust(73, " ")} \033[1;34m|\033[0m'
6665
)
6766
print(
6867
f'\033[1;34m|\033[0m status_code={repo.pull_request_status_code} reason={repo.pull_request_reason} \033[1;34m|\033[0m'

0 commit comments

Comments
 (0)