Skip to content

Commit ccb9cc7

Browse files
committed
merge
2 parents 87e5ff6 + c2b93ba commit ccb9cc7

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/superannotate/lib/infrastructure/controller.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,17 @@ def init(self, config_path=None):
7272
if not config_path:
7373
config_path = constances.CONFIG_FILE_LOCATION
7474
config_path = Path(expanduser(config_path))
75+
if str(config_path) == constances.CONFIG_FILE_LOCATION:
76+
if not Path(self._config_path).is_file():
77+
self.configs.insert(ConfigEntity("main_endpoint", constances.BACKEND_URL))
78+
self.configs.insert(ConfigEntity("token", ""))
79+
return
7580
if not config_path.is_file():
7681
raise AppException(
7782
f"SuperAnnotate config file {str(config_path)} not found."
7883
f" Please provide correct config file location to sa.init(<path>) or use "
7984
f"CLI's superannotate init to generate default location config file."
8085
)
81-
if str(config_path) == constances.CONFIG_FILE_LOCATION:
82-
if not Path(self._config_path).is_file():
83-
self.configs.insert(ConfigEntity("main_endpoint", constances.BACKEND_URL))
84-
self.configs.insert(ConfigEntity("token", ""))
85-
return
86-
8786
self._config_path = config_path
8887
token, main_endpoint = (
8988
self.configs.get_one("token"),

0 commit comments

Comments
 (0)