diff options
author | Adam Harrison <adamdharrison@gmail.com> | 2024-03-08 13:35:39 -0500 |
---|---|---|
committer | Adam Harrison <adamdharrison@gmail.com> | 2024-03-08 13:35:39 -0500 |
commit | ae5b41ef19ac9cc806b749821c0881aac177f3c6 (patch) | |
tree | e59e238117dca3724d9a66a38e85fe6f452de586 /src/lpm.lua | |
parent | 36da687203b80391d32e43475b9288468bea07c4 (diff) | |
download | lite-xl-plugin-manager-ae5b41ef19ac9cc806b749821c0881aac177f3c6.tar.gz lite-xl-plugin-manager-ae5b41ef19ac9cc806b749821c0881aac177f3c6.zip |
Removed files that fail checks.
Diffstat (limited to 'src/lpm.lua')
-rw-r--r-- | src/lpm.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lpm.lua b/src/lpm.lua index 8e972ae..c611d51 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -581,7 +581,10 @@ function common.get(source, options) if not system.stat(cache_path) then res, headers = system.get(protocol, hostname, port, rest, cache_path .. ".part", callback) if headers.location then return common.get(headers.location, common.merge(options, { depth = (depth or 0) + 1 })) end - if checksum ~= "SKIP" and system.hash(cache_path .. ".part", "file") ~= checksum then fatal_warning("checksum doesn't match for " .. source) end + if checksum ~= "SKIP" and system.hash(cache_path .. ".part", "file") ~= checksum then + common.rmrf(cache_path .. ".part") + fatal_warning("checksum doesn't match for " .. source) + end common.rename(cache_path .. ".part", cache_path) end if target then common.copy(cache_path, target) else res = io.open(cache_path, "rb"):read("*all") end |