diff options
| -rw-r--r-- | xmake/core/package/package.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/private/action/require/impl/actions/download_resources.lua | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 6da128eb4..29499663b 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -2279,7 +2279,12 @@ end function _instance:resourcedir(name) local resource = self:resource(name) if resource and resource.url then - return path.join(self:cachedir(), "resources", name, (path.filename(resource.url):gsub("%?.+$", "")) .. ".dir") + local resourceurl = resource.url + local resourcedir = path.join(self:cachedir(), "resources", name, (path.filename(resourceurl):gsub("%?.+$", ""))) + if not resourceurl:startswith("git://") and not resourceurl:endswith(".git") then + resourcedir = resourcedir .. ".dir" + end + return resourcedir end end diff --git a/xmake/modules/private/action/require/impl/actions/download_resources.lua b/xmake/modules/private/action/require/impl/actions/download_resources.lua index 9c6f06e78..30e7f9146 100644 --- a/xmake/modules/private/action/require/impl/actions/download_resources.lua +++ b/xmake/modules/private/action/require/impl/actions/download_resources.lua @@ -137,9 +137,9 @@ function _download(package, resource_name, resource_url, resource_hash) local extension = archive.extension(resource_file) local errors local ok = try { - function() + function () archive.extract(resource_file, resourcedir_tmp) - return true + return true end, catch { function (errs) |
