Skip to content

Commit ef67042

Browse files
authored
Merge pull request #6397 from Shiffted/plugin_install
Add custom git url syntax to plugin --install
2 parents ea13d87 + 8395657 commit ef67042

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

xmake/modules/devel/git/asgiturl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function main(url)
4040

4141
-- check
4242
url = url:trim()
43-
assert(#url > 0)
43+
assert(#url > 0, "provided URL is empty!")
4444

4545
-- safe because all custom_protocol supports https
4646
local lower = url:lower()

xmake/plugins/plugin/main.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ import("private.action.require.impl.environment")
2828
-- get plugin urls
2929
function _plugin_urls()
3030
local urls = option.get("plugins")
31-
if not urls then
31+
if urls then
32+
local result = {}
33+
for _, url in ipairs(urls) do
34+
table.insert(result, git.asgiturl(url) or url)
35+
end
36+
urls = result
37+
else
3238
urls = {
3339
"https://github.com/xmake-io/xmake-plugins.git",
3440
"https://gitlab.com/tboox/xmake-plugins.git",

0 commit comments

Comments
 (0)