summaryrefslogtreecommitdiff
path: root/xmake/core
diff options
context:
space:
mode:
authorruki <[email protected]>2018-09-12 00:45:05 +0800
committerruki <[email protected]>2018-09-11 22:30:34 +0800
commit26271fd2ef89939e415d6ab206a413358b9045d4 (patch)
tree09562e38ef62fb874508832d9c861525d4b2fab2 /xmake/core
parentf79eb8dfdb0e94aec8d656cdc1f3fe88cc040d40 (diff)
improve to install package
Diffstat (limited to 'xmake/core')
-rw-r--r--xmake/core/sandbox/modules/import/core/package/repository.lua11
1 files changed, 8 insertions, 3 deletions
diff --git a/xmake/core/sandbox/modules/import/core/package/repository.lua b/xmake/core/sandbox/modules/import/core/package/repository.lua
index 16fab448a..499d2e902 100644
--- a/xmake/core/sandbox/modules/import/core/package/repository.lua
+++ b/xmake/core/sandbox/modules/import/core/package/repository.lua
@@ -88,9 +88,9 @@ function sandbox_core_package_repository.repositories(is_global)
fasturl.add(mainurls)
mainurls = fasturl.sort(mainurls)
- -- add main urls
- for _, mainurl in ipairs(mainurls) do
- local repo = repository.load("xmake-repo", mainurl, true)
+ -- add main url
+ if #mainurls > 0 then
+ local repo = repository.load("xmake-repo", mainurls[1], true)
if repo then
table.insert(repositories, repo)
end
@@ -107,6 +107,11 @@ function sandbox_core_package_repository.repositories(is_global)
end
-- load repositories from project file
+ --
+ -- in project xmake.lua:
+ --
+ -- add_repositories("other-repo https://github.com/other/other-repo.git")
+ --
if not is_global then
for _, repo in ipairs(table.wrap(project.get("repositories"))) do
local repoinfo = repo:split(' ')