Skip to content

Commit bcba527

Browse files
committed
CODEFLASH_DISABLE_TELEMETRY environment variable can be set to disable telemetry
1 parent a10600c commit bcba527

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

codeflash/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
solved problem, please reach out to us at [email protected]. We're hiring!
33
"""
44

5+
import os
56
from pathlib import Path
67

78
from codeflash.cli_cmds.cli import parse_args, process_pyproject_config
@@ -20,12 +21,12 @@ def main() -> None:
2021
CODEFLASH_LOGO, panel_args={"title": "https://codeflash.ai", "expand": False}, text_args={"style": "bold gold3"}
2122
)
2223
args = parse_args()
24+
2325
if args.command:
24-
if args.config_file and Path.exists(args.config_file):
26+
disable_telemetry = os.environ.get("CODEFLASH_DISABLE_TELEMETRY", "").lower() in {"true", "t", "1", "yes", "y"}
27+
if (not disable_telemetry) and args.config_file and Path.exists(args.config_file):
2528
pyproject_config, _ = parse_config_file(args.config_file)
2629
disable_telemetry = pyproject_config.get("disable_telemetry", False)
27-
else:
28-
disable_telemetry = False
2930
init_sentry(not disable_telemetry, exclude_errors=True)
3031
posthog_cf.initialize_posthog(not disable_telemetry)
3132
args.func()

0 commit comments

Comments
 (0)