summaryrefslogtreecommitdiff
path: root/xmake/plugins
diff options
context:
space:
mode:
authorruki <[email protected]>2017-09-27 23:19:51 +0800
committerruki <[email protected]>2017-09-27 13:59:10 +0800
commitbee50fa70e44973ff43d2c6adeb96a18f4b38148 (patch)
treed70e4d2a28216793d65c0f79e936fcad5b71b17b /xmake/plugins
parentca581595f689b8ec3de720560ab3946745889936 (diff)
fix repo environment
Diffstat (limited to 'xmake/plugins')
-rw-r--r--xmake/plugins/repo/main.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/plugins/repo/main.lua b/xmake/plugins/repo/main.lua
index 344e4eb4e..e80bad1c2 100644
--- a/xmake/plugins/repo/main.lua
+++ b/xmake/plugins/repo/main.lua
@@ -29,6 +29,7 @@ import("core.project.project")
import("core.platform.platform")
import("core.package.repository")
import("devel.git")
+import("actions.require.environment", {rootdir = os.programdir()})
-- add repository url
function _add(name, url, is_global)
@@ -42,11 +43,17 @@ function _add(name, url, is_global)
os.rmdir(repodir)
end
+ -- enter environment
+ environment.enter()
+
-- clone repository
git.clone(url, {verbose = option.get("verbose"), branch = "master", outputdir = repodir})
-- trace
cprint("${bright}add %s repository(%s): %s ok!", ifelse(is_global, "global", "local"), name, url)
+
+ -- leave environment
+ environment.leave()
end
-- remove repository url
@@ -68,6 +75,9 @@ end
-- update repositories
function _update()
+ -- enter environment
+ environment.enter()
+
-- trace
printf("updating repositories .. ")
if option.get("verbose") then
@@ -117,6 +127,9 @@ function _update()
process.asyncrun(task)
end
+ -- leave environment
+ environment.leave()
+
-- trace
cprint("${green}ok")
end