summaryrefslogtreecommitdiff
path: root/xmake/modules/private
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-12 22:45:38 +0800
committerruki <[email protected]>2022-04-12 22:45:38 +0800
commit52f324b543b512f53a75a653f3b32cc7dbfe601e (patch)
tree078624d3ea1897918b383e30dba6c56677da710e /xmake/modules/private
parent314c329ed33997af84bb0971965a15f3cc7cdbb4 (diff)
improve reset dir
Diffstat (limited to 'xmake/modules/private')
-rw-r--r--xmake/modules/private/service/remote_build/session.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/modules/private/service/remote_build/session.lua b/xmake/modules/private/service/remote_build/session.lua
index 34a247f59..7d961faaa 100644
--- a/xmake/modules/private/service/remote_build/session.lua
+++ b/xmake/modules/private/service/remote_build/session.lua
@@ -21,6 +21,7 @@
-- imports
import("core.base.object")
import("core.base.global")
+import("devel.git")
import("private.service.config")
-- define module
@@ -75,6 +76,18 @@ end
-- reset sourcedir
function session:_reset_sourcedir()
+
+ -- init sourcedir first if .git not exists
+ local sourcedir = self:sourcedir()
+ if not os.isdir(sourcedir) then
+ os.mkdir(sourcedir)
+ end
+ if not os.isdir(path.join(sourcedir, ".git")) then
+ git.init({repodir = sourcedir})
+ end
+
+ -- checkout and reset branch
+ -- TODO
end
function session:__tostring()