Skip to content

Commit

Permalink
move warning about private repos to stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
dhellmann committed Jul 11, 2022
1 parent 98aea01 commit 1fcd5a7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ghcloneall.py
Expand Up @@ -930,7 +930,8 @@ def _main():
return

if args.include_private and not args.github_token:
print('Warning: Listing private repositories requires a GitHub token')
print('Warning: Listing private repositories requires a GitHub token',
file=sys.stderr)
args.include_private = False
if args.include_private is None:
args.include_private = bool(args.github_token)
Expand Down
8 changes: 5 additions & 3 deletions tests.py
Expand Up @@ -1464,12 +1464,14 @@ def test_main_run_private_without_token(monkeypatch, mock_requests_get,
],
))
ghcloneall.main()
assert show_ansi_result(capsys.readouterr().out) == (
'Warning: Listing private repositories requires a GitHub token\n'
captured = capsys.readouterr()
assert show_ansi_result(captured.out) == (
'+ ghcloneall (new)\n'
'1 repositories: 0 updated, 1 new, 0 dirty.'
)

assert captured.err == (
'Warning: Listing private repositories requires a GitHub token\n'
)

def test_main_run_start_from(monkeypatch, mock_requests_get, capsys):
monkeypatch.setattr(sys, 'argv', [
Expand Down

0 comments on commit 1fcd5a7

Please sign in to comment.