Skip to content

Commit 071bf45

Browse files
Merge pull request #131 from roboflow/fixWindowsConf
Fix windows conf
2 parents ae7634a + 93b7d85 commit 071bf45

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

roboflow/__init__.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from roboflow.core.workspace import Workspace
1313
from roboflow.util.general import write_line
1414

15-
__version__ = "1.0.2"
15+
__version__ = "1.0.3"
1616

1717

1818
def check_key(api_key, model, notebook, num_retries=0):
@@ -72,9 +72,17 @@ def auth(api_key):
7272

7373

7474
def login(workspace=None, force=False):
75+
os_name = os.name
76+
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
7583
conf_location = os.getenv(
7684
"ROBOFLOW_CONFIG_DIR",
77-
default=os.getenv("HOME") + "/.config/roboflow/config.json",
85+
default=default_path,
7886
)
7987

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

roboflow/config.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +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
1825
conf_location = os.getenv(
1926
"ROBOFLOW_CONFIG_DIR",
20-
default=os.path.expanduser("~") + "/.config/roboflow/config.json",
27+
default=default_path,
2128
)
2229

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

0 commit comments

Comments
 (0)