Commit 6f3ed146 authored by Cyril Matthey-Doret's avatar Cyril Matthey-Doret
Browse files

print token prompt to stderr instead of stdout

parent 69971f4c
......@@ -140,7 +140,9 @@ def format_fork_metadata(
)
def main(repo_url, token, deadline=None):
if token is None:
token = click.prompt("Please enter your Gitlab API token", hide_input=True)
token = click.prompt(
"Please enter your Gitlab API token", hide_input=True, err=True
)
else:
token = open(token).read().strip()
# Check for valid deadline format
......
......@@ -56,7 +56,9 @@ def main(emails_file, group_url, token):
Send invitations to join input gitlab group to all emails in the emails_file.
The file should have one email per line."""
if token is None:
token = click.prompt("Please enter your Gitlab API token", hide_input=True)
token = click.prompt(
"Please enter your Gitlab API token", hide_input=True, err=True
)
else:
token = open(token).read().strip()
header = {"PRIVATE-TOKEN": token}
......
......@@ -63,7 +63,9 @@ def main(student_table, parent_url, token):
and "Surname"
"""
if token is None:
token = click.prompt("Please enter your Gitlab API token", hide_input=True)
token = click.prompt(
"Please enter your Gitlab API token", hide_input=True, err=True
)
else:
token = open(token).read().strip()
......
......@@ -87,7 +87,9 @@ def main(forks, feedback, token, template):
# Build header with authentication token
if token is None:
token = click.prompt("Please enter your Gitlab API token", hide_input=True)
token = click.prompt(
"Please enter your Gitlab API token", hide_input=True, err=True
)
else:
token = open(token).read().strip()
header = {"PRIVATE-TOKEN": token}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment