Skip to content

Commit ac61cf1

Browse files
committed
ask for username and password if not provided
1 parent 77d40ab commit ac61cf1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/virtualship/cli/commands.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from virtualship.expedition.do_expedition import _get_schedule, do_expedition
99
from virtualship.utils import SCHEDULE, SHIP_CONFIG
1010

11+
from getpass import getpass
1112

1213
@click.command(
1314
help="Initialize a directory for a new expedition, with an example configuration."
@@ -59,8 +60,11 @@ def init(path):
5960
)
6061
def fetch(path: str | Path, username: str | None, password: str | None) -> None:
6162
"""Entrypoint for the tool to download data based on area of interest."""
62-
if sum([username is None, password is None]) == 1:
63-
raise ValueError("Both username and password must be provided.")
63+
if username is None:
64+
username = str(input("Username:"))
65+
66+
if (password is None):
67+
password = getpass("Password:")
6468

6569
path = Path(path)
6670

0 commit comments

Comments
 (0)