mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-11 18:41:11 +01:00
fix: warn when --private used without authentication
This commit is contained in:
@@ -9,6 +9,7 @@ from github_backup.github_backup import (
|
|||||||
backup_repositories,
|
backup_repositories,
|
||||||
check_git_lfs_install,
|
check_git_lfs_install,
|
||||||
filter_repositories,
|
filter_repositories,
|
||||||
|
get_auth,
|
||||||
get_authenticated_user,
|
get_authenticated_user,
|
||||||
logger,
|
logger,
|
||||||
mkdir_p,
|
mkdir_p,
|
||||||
@@ -37,6 +38,12 @@ logging.basicConfig(level=logging.INFO, handlers=[stdout_handler, stderr_handler
|
|||||||
def main():
|
def main():
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
|
||||||
|
if args.private and not get_auth(args):
|
||||||
|
logger.warning(
|
||||||
|
"The --private flag has no effect without authentication. "
|
||||||
|
"Use -t/--token, -f/--token-fine, or -u/--username to authenticate."
|
||||||
|
)
|
||||||
|
|
||||||
if args.quiet:
|
if args.quiet:
|
||||||
logger.setLevel(logging.WARNING)
|
logger.setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user