File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ def _create_startup_config(logger):
120120 config .read (should_raise = False )
121121 else :
122122 _read_config (config , logger )
123+ _ensure_profile (config , logger )
123124 _validate_config (config , logger )
124125 return config
125126
@@ -135,6 +136,19 @@ def _read_config(config, logger):
135136 raise errors .ConfigError (e )
136137
137138
139+ def _ensure_profile (config , logger ):
140+ if config .profile is None :
141+ # no selected profile or profile not found
142+ try :
143+ config .select_profile (common_constants .DEFAULT_PROFILE )
144+ except KeyError :
145+ logger .error (f"Missing default profiles. Please make sure that the { config .profiles_path } "
146+ f"folder is accessible. To reinstall default profiles, delete the "
147+ f"'{ tentacles_manager_constants .TENTACLES_PATH } ' "
148+ f"folder or start OctoBot with the following arguments: tentacles --install --all" )
149+ raise errors .NoProfileError
150+
151+
138152def _validate_config (config , logger ):
139153 try :
140154 config .validate ()
You can’t perform that action at this time.
0 commit comments