aboutsummaryrefslogtreecommitdiff
path: root/src/lpm.lua
diff options
context:
space:
mode:
authorAdam Harrison <adamdharrison@gmail.com>2023-08-18 09:12:46 -0400
committerAdam Harrison <adamdharrison@gmail.com>2023-08-18 09:12:46 -0400
commit5c6c296680b3dcfbd5c6e211b78e4659e59fe623 (patch)
treef616eb7727d95f422aeb8a7249995e8439858228 /src/lpm.lua
parent6bcc10e083a050d27af480b0e81510d1d1527b15 (diff)
downloadlite-xl-plugin-manager-5c6c296680b3dcfbd5c6e211b78e4659e59fe623.tar.gz
lite-xl-plugin-manager-5c6c296680b3dcfbd5c6e211b78e4659e59fe623.zip
Allowed for extracting of .gz files without an associated tar.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r--src/lpm.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lpm.lua b/src/lpm.lua
index 1a118de..14cc724 100644
--- a/src/lpm.lua
+++ b/src/lpm.lua
@@ -857,9 +857,9 @@ function Addon:install(bottle, installing)
else
common.get(file.url, temporary_path, file.checksum, write_progress_bar)
local basename = common.basename(target_path)
- if basename:find("%.zip$") or basename:find("%.tar%.gz$") then
+ if basename:find("%.zip$") or basename:find("%.tar%.gz$") or basename:find("%.gz$") then
log_action("Extracting file " .. basename .. " in " .. install_path)
- system.extract(temporary_path, temporary_install_path)
+ system.extract(temporary_path, temporary_install_path .. (not basename:find("%.tar%.gz$") and basename:find("%.gz$") and (PATHSEP .. basename:gsub(".gz$", "")) or ""))
os.remove(temporary_path)
else
if file.arch and file.arch ~= "*" then system.chmod(temporary_path, 448) end -- chmod any ARCH tagged file to rwx-------