From ae16fed39b605e22c426da99beda57849a540422 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 14 Aug 2022 19:01:58 +0530 Subject: [PATCH] Fix repeated make app failing on macOS --- setup.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 999dfb9f1..f69b0840f 100755 --- a/setup.py +++ b/setup.py @@ -1252,9 +1252,10 @@ def create_minimal_macos_bundle(args: Options, launcher_dir: str) -> None: with open(os.path.join(kapp, 'Contents/Info.plist'), 'wb') as f: f.write(macos_info_plist()) build_launcher(args, bin_dir) - os.symlink( - os.path.join(os.path.relpath(bin_dir, launcher_dir), appname), - os.path.join(launcher_dir, appname)) + kitty_exe = os.path.join(launcher_dir, appname) + with suppress(FileNotFoundError): + os.remove(kitty_exe) + os.symlink(os.path.join(os.path.relpath(bin_dir, launcher_dir), appname), kitty_exe) create_macos_app_icon(resources_dir)