Skip to content

Commit 5713ee0

Browse files
manager: Use components_paths getter method
1 parent 6d21956 commit 5713ee0

File tree

1 file changed

+1
-55
lines changed

1 file changed

+1
-55
lines changed

bottles/backend/managers/manager.py

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ def checks(self, install_latest=False, first_run=False) -> Result:
156156

157157
rv = Result(status=True, data={})
158158

159-
self.check_app_dirs()
160-
rv.data["check_app_dirs"] = time.time()
159+
map(lambda path: os.makedirs(path, exist_ok=True), Paths.get_components_paths())
161160

162161
self.check_dxvk(install_latest) or rv.set_status(False)
163162
rv.data["check_dxvk"] = time.time()
@@ -197,59 +196,6 @@ def update_bottles(self, silent: bool = False):
197196
self.check_bottles(silent)
198197
SignalManager.send(Signals.ManagerLocalBottlesLoaded)
199198

200-
def check_app_dirs(self):
201-
"""
202-
Checks for the existence of the bottles' directories, and creates them
203-
if they don't exist.
204-
"""
205-
if not os.path.isdir(Paths.runners):
206-
logging.info("Runners path doesn't exist, creating now.")
207-
os.makedirs(Paths.runners, exist_ok=True)
208-
209-
if not os.path.isdir(Paths.runtimes):
210-
logging.info("Runtimes path doesn't exist, creating now.")
211-
os.makedirs(Paths.runtimes, exist_ok=True)
212-
213-
if not os.path.isdir(Paths.winebridge):
214-
logging.info("WineBridge path doesn't exist, creating now.")
215-
os.makedirs(Paths.winebridge, exist_ok=True)
216-
217-
if not os.path.isdir(Paths.bottles):
218-
logging.info("Bottles path doesn't exist, creating now.")
219-
os.makedirs(Paths.bottles, exist_ok=True)
220-
221-
if (
222-
self.settings.get_boolean("steam-proton-support")
223-
and self.steam_manager.is_steam_supported
224-
):
225-
if not os.path.isdir(Paths.steam):
226-
logging.info("Steam path doesn't exist, creating now.")
227-
os.makedirs(Paths.steam, exist_ok=True)
228-
229-
if not os.path.isdir(Paths.dxvk):
230-
logging.info("Dxvk path doesn't exist, creating now.")
231-
os.makedirs(Paths.dxvk, exist_ok=True)
232-
233-
if not os.path.isdir(Paths.vkd3d):
234-
logging.info("Vkd3d path doesn't exist, creating now.")
235-
os.makedirs(Paths.vkd3d, exist_ok=True)
236-
237-
if not os.path.isdir(Paths.nvapi):
238-
logging.info("Nvapi path doesn't exist, creating now.")
239-
os.makedirs(Paths.nvapi, exist_ok=True)
240-
241-
if not os.path.isdir(Paths.templates):
242-
logging.info("Templates path doesn't exist, creating now.")
243-
os.makedirs(Paths.templates, exist_ok=True)
244-
245-
if not os.path.isdir(Paths.temp):
246-
logging.info("Temp path doesn't exist, creating now.")
247-
os.makedirs(Paths.temp, exist_ok=True)
248-
249-
if not os.path.isdir(Paths.latencyflex):
250-
logging.info("LatencyFleX path doesn't exist, creating now.")
251-
os.makedirs(Paths.latencyflex, exist_ok=True)
252-
253199
@RunAsync.run_async
254200
def organize_components(self):
255201
"""Get components catalog and organizes into supported_ lists."""

0 commit comments

Comments
 (0)