Skip to content

Commit c1ebc6f

Browse files
committed
propagate conf location to login too
1 parent 1b4f8f9 commit c1ebc6f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

roboflow/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,17 @@ def auth(api_key):
7272

7373

7474
def login(workspace=None, force=False):
75-
home_dir = os.getenv("HOME") or os.getenv("USERPROFILE")
75+
os_name = os.name
7676

77+
if os_name == "nt":
78+
default_path = os.getenv("USERPROFILE") + "\\roboflow\\config.json"
79+
else:
80+
default_path = os.getenv("HOME") + "/.config/roboflow/config.json"
81+
82+
# default configuration location
7783
conf_location = os.getenv(
78-
home_dir,
79-
default=os.getenv("HOME") + "/.config/roboflow/config.json",
84+
"ROBOFLOW_CONFIG_DIR",
85+
default=default_path,
8086
)
8187

8288
if os.path.isfile(conf_location) and not force:

0 commit comments

Comments
 (0)