Skip to content

Commit 3bc1cb7

Browse files
Support for Windows Configuration
1 parent 4a2db10 commit 3bc1cb7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

roboflow/config.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ def get_conditional_configuration_variable(key, default):
1414
string: The value of the conditional configuration variable.
1515
"""
1616

17+
os_name = os.name
18+
19+
if os_name == "nt":
20+
default_path = os.getenv("USERPROFILE") + "\\roboflow\\config.json"
21+
else:
22+
default_path = os.getenv("HOME") + "/.config/roboflow/config.json"
23+
1724
# default configuration location
18-
# add support for windows
1925
conf_location = os.getenv(
2026
"ROBOFLOW_CONFIG_DIR",
21-
default=f"os.getenv('HOME')/.config/roboflow/config.json",
27+
default=default_path,
2228
)
2329

2430
# read config file for roboflow if logged in from python or CLI

0 commit comments

Comments
 (0)