diff options
| author | xq114 <[email protected]> | 2023-02-23 19:39:56 +0800 |
|---|---|---|
| committer | xq114 <[email protected]> | 2023-02-23 19:39:56 +0800 |
| commit | 9a63f4f86064a047bfb3e4003ff71627d52e6efa (patch) | |
| tree | 2bfed4defa0753f8f448bdf4f2904affa47b0be2 | |
| parent | 3a9765192608ee20de3d6448b24bde0095a7274c (diff) | |
deduplicate match
| -rw-r--r-- | xmake/modules/private/action/require/impl/utils/url_filename.lua | 8 |
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 |
