summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-04-15 22:48:41 +0800
committerruki <[email protected]>2022-04-15 22:48:41 +0800
commitf15c240d254126ab5b4ba0db0cd6acb5d3090dd3 (patch)
treef23ee2a3395d9d9f86134e790d59163174132981
parentabee3747fe8a4673e6d5a2d53f78bf98847b8d07 (diff)
improve service
-rw-r--r--xmake/modules/private/service/start_service.lua16
-rw-r--r--xmake/repository/packages/g/git/xmake.lua2
2 files changed, 17 insertions, 1 deletions
diff --git a/xmake/modules/private/service/start_service.lua b/xmake/modules/private/service/start_service.lua
index 07ec76c8e..36ba70f1b 100644
--- a/xmake/modules/private/service/start_service.lua
+++ b/xmake/modules/private/service/start_service.lua
@@ -20,13 +20,29 @@
-- imports
import("core.base.option")
+import("core.project.project")
import("private.service.config")
import("private.service.service")
import("private.service.remote_build.environment")
function main(opt)
opt = opt or {}
+
+ -- enter a working directory
+ local workdir = path.join(os.tmpdir(), "service")
+ if not os.isdir(workdir) then
+ os.mkdir(workdir)
+ os.cd(workdir)
+ os.vrunv("xmake", {"create", "-P", "."})
+ else
+ os.cd(workdir)
+ end
+ project.chdir(workdir)
+
+ -- enter environment
environment.enter()
+
+ -- start service
if opt.daemon then
local argv = {"lua"}
if option.get("verbose") then
diff --git a/xmake/repository/packages/g/git/xmake.lua b/xmake/repository/packages/g/git/xmake.lua
index c90cdf241..b8418a005 100644
--- a/xmake/repository/packages/g/git/xmake.lua
+++ b/xmake/repository/packages/g/git/xmake.lua
@@ -25,7 +25,7 @@ package("git")
end
on_load("windows", function (package)
- package:addenv("PATH", path.join("share", "MinGit", "mingw32", "bin"))
+ package:addenv("PATH", path.join("share", "MinGit", package:is_arch("x86_64", "x64") and "mingw64" or "mingw32", "bin"))
package:addenv("PATH", path.join("share", "MinGit", "cmd"))
end)