From dd15242cf765e6511d7da50ac41fa29a7fb57fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9raphin?= <1567690+serahug@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:38:15 +0100 Subject: [PATCH 1/2] fix: remove mkdir before pkgutil --expand --- hooks/post_install.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/post_install.lua b/hooks/post_install.lua index 3a8a759..353aa20 100644 --- a/hooks/post_install.lua +++ b/hooks/post_install.lua @@ -22,9 +22,9 @@ function PLUGIN:PostInstall(ctx) error("Could not find Carthage.pkg in " .. rootPath) end - -- Create extraction directory + -- Clean extraction directory local expand_dir = rootPath .. "/expanded" - os.execute(string.format('mkdir -p "%s"', expand_dir)) + os.execute(string.format('rm -rf "%s"', expand_dir)) -- Expand the .pkg file using pkgutil local expand_cmd = string.format('pkgutil --expand "%s" "%s"', pkg_path, expand_dir) From 93c7d05a7987f0d7e3c21093de19b41d928dd7e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9raphin?= <1567690+serahug@users.noreply.github.com> Date: Sun, 1 Feb 2026 15:48:45 +0100 Subject: [PATCH 2/2] Review --- hooks/post_install.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hooks/post_install.lua b/hooks/post_install.lua index 353aa20..8237a3e 100644 --- a/hooks/post_install.lua +++ b/hooks/post_install.lua @@ -24,7 +24,9 @@ function PLUGIN:PostInstall(ctx) -- Clean extraction directory local expand_dir = rootPath .. "/expanded" - os.execute(string.format('rm -rf "%s"', expand_dir)) + if not os.execute(string.format('rm -rf "%s"', expand_dir)) then + error('Failed to clean extraction directory: ' .. expand_dir) + end -- Expand the .pkg file using pkgutil local expand_cmd = string.format('pkgutil --expand "%s" "%s"', pkg_path, expand_dir)