summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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