From de3f3f93afdb88e3867faba3ab393b0ae3558340 Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 4 Jan 2022 15:39:24 +0100 Subject: [PATCH] [cli] Do not try to delete (~)/Applications on macOS It would fail, but is not considered polite either. --- legendary/core.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/legendary/core.py b/legendary/core.py index 5745e21..a32e258 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1467,6 +1467,10 @@ class LegendaryCore: self.egl_uninstall(installed_game, delete_files=delete_files) if delete_files: + # DO NOT attempt to delete /Applications or ~/Applications on macOS. That'd be a bad idea. + if installed_game.platform == 'Mac' and installed_game.install_path.endswith('/Applications'): + delete_root_directory = False + try: manifest = self.load_manifest(self.get_installed_manifest(installed_game.app_name)[0]) filelist = [