Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit ba05a63

Browse files
committed
check for interactive session before email prompt
1 parent f80dc58 commit ba05a63

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

data_diff/tracking.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import urllib.request
1212
from uuid import uuid4
1313
import toml
14+
from rich import get_console
1415

1516
from .version import __version__
1617

@@ -41,7 +42,7 @@ def bool_ask_for_email() -> bool:
4142
"""
4243
Checks the .datadiff.toml profile file for the asked_for_email key
4344
44-
Returns False immediately if --no-tracking
45+
Returns False immediately if --no-tracking or not in an interactive terminal
4546
4647
If found, return False (already asked for email)
4748
@@ -50,7 +51,8 @@ def bool_ask_for_email() -> bool:
5051
Returns:
5152
bool: decision on whether to prompt the user for their email
5253
"""
53-
if g_tracking_enabled:
54+
console = get_console()
55+
if g_tracking_enabled and console.is_interactive:
5456
profile = _load_profile()
5557

5658
if "asked_for_email" not in profile:

0 commit comments

Comments
 (0)