summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorxq114 <[email protected]>2023-02-23 19:39:56 +0800
committerxq114 <[email protected]>2023-02-23 19:39:56 +0800
commit9a63f4f86064a047bfb3e4003ff71627d52e6efa (patch)
tree2bfed4defa0753f8f448bdf4f2904affa47b0be2 /xmake/modules
parent3a9765192608ee20de3d6448b24bde0095a7274c (diff)
deduplicate match
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/private/action/require/impl/utils/url_filename.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/xmake/modules/private/action/require/impl/utils/url_filename.lua b/xmake/modules/private/action/require/impl/utils/url_filename.lua
index 9694964ea..c0d472e6d 100644
--- a/xmake/modules/private/action/require/impl/utils/url_filename.lua
+++ b/xmake/modules/private/action/require/impl/utils/url_filename.lua
@@ -26,15 +26,13 @@ end
-- get filename from github name mangling
function github_filename(url)
- if url:find("^https://github.com/[^/]-/[^/]-/archive/") then
- local reponame = url:match("^https://github.com/[^/]-/([^/]-)/archive/")
+ local reponame = url:match("^https://github.com/[^/]-/([^/]-)/archive/")
+ if reponame then
local filename = raw_filename(url)
if filename:find("^v%d") then
filename = filename:match("^v(.+)")
end
- if reponame and filename then
- return reponame .. "-" .. filename
- end
+ return reponame .. "-" .. filename
end
end