Skip to content

Commit aba048a

Browse files
committed
fix: warn when --private used without authentication
1 parent 9f7c081 commit aba048a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

bin/github-backup

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from github_backup.github_backup import (
99
backup_repositories,
1010
check_git_lfs_install,
1111
filter_repositories,
12+
get_auth,
1213
get_authenticated_user,
1314
logger,
1415
mkdir_p,
@@ -37,6 +38,12 @@ logging.basicConfig(level=logging.INFO, handlers=[stdout_handler, stderr_handler
3738
def main():
3839
args = parse_args()
3940

41+
if args.private and not get_auth(args):
42+
logger.warning(
43+
"The --private flag has no effect without authentication. "
44+
"Use -t/--token, -f/--token-fine, or -u/--username to authenticate."
45+
)
46+
4047
if args.quiet:
4148
logger.setLevel(logging.WARNING)
4249

0 commit comments

Comments
 (0)