summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2025-08-01 22:53:54 +0800
committerruki <[email protected]>2025-08-01 22:53:54 +0800
commitb2628769d3206449e9301cb86bd87df9c789ccd5 (patch)
tree2d6eca73c0f3feff1b734130e605d61e2d73b777
parentb3cb622624e0fdd7bf26f6237f4c8abeb0d446a0 (diff)
improve resourcedir #6666
-rw-r--r--xmake/core/package/package.lua7
-rw-r--r--xmake/modules/private/action/require/impl/actions/download_resources.lua4
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)