diff options
| author | ruki <[email protected]> | 2025-05-07 17:15:23 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-05-07 17:15:23 +0800 |
| commit | ef6704260b307376a23ef0638c1ee8e48a4dbc5c (patch) | |
| tree | b51dde554cbc87bfe3543c5c5f702611980a1d5a | |
| parent | ea13d87b271fbfe6ec96b90cb6b315220f4c53e9 (diff) | |
| parent | 8395657438d132634d87b8c5c8b519147fa1ccec (diff) | |
Merge pull request #6397 from Shiffted/plugin_install
Add custom git url syntax to plugin --install
| -rw-r--r-- | xmake/modules/devel/git/asgiturl.lua | 2 | ||||
| -rw-r--r-- | xmake/plugins/plugin/main.lua | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/xmake/modules/devel/git/asgiturl.lua b/xmake/modules/devel/git/asgiturl.lua index 7a336b930..cd4f271fd 100644 --- a/xmake/modules/devel/git/asgiturl.lua +++ b/xmake/modules/devel/git/asgiturl.lua @@ -40,7 +40,7 @@ function main(url) -- check url = url:trim() - assert(#url > 0) + assert(#url > 0, "provided URL is empty!") -- safe because all custom_protocol supports https local lower = url:lower() diff --git a/xmake/plugins/plugin/main.lua b/xmake/plugins/plugin/main.lua index 915439ae8..a5a7f9ad0 100644 --- a/xmake/plugins/plugin/main.lua +++ b/xmake/plugins/plugin/main.lua @@ -28,7 +28,13 @@ import("private.action.require.impl.environment") -- get plugin urls function _plugin_urls() local urls = option.get("plugins") - if not urls then + if urls then + local result = {} + for _, url in ipairs(urls) do + table.insert(result, git.asgiturl(url) or url) + end + urls = result + else urls = { "https://github.com/xmake-io/xmake-plugins.git", "https://gitlab.com/tboox/xmake-plugins.git", |
