Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hooks/post_install.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function PLUGIN:PostInstall(ctx)
os.execute(string.format("rm -rf '%s/luarocks.tar.gz' '%s/luarocks-'*", sdkPath, sdkPath))
end

-- Clean up Lua source files (keep only bin, lib, include, man, share, luarocks)
local cleanCmd = string.format("cd '%s' && rm -rf src doc Makefile README install 2>/dev/null", sdkPath)
-- Clean up Lua source files (keep bin, lib, include, man, share, src, luarocks)
local cleanCmd = string.format("cd '%s' && rm -rf doc Makefile README install 2>/dev/null", sdkPath)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The comment on line 113 is now outdated as it does not include src in the list of kept directories. Please update it to reflect that src is now preserved to maintain consistency between the code and its documentation.

Additionally, using %q in string.format is a more robust way to handle sdkPath in the shell command, as it automatically handles quoting and escaping for paths that might contain spaces or special characters (like single quotes).

    local cleanCmd = string.format("cd %q && rm -rf doc Makefile README install 2>/dev/null", sdkPath)

os.execute(cleanCmd)
end