summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-17 00:38:59 +0800
committerruki <[email protected]>2020-06-16 21:53:57 +0800
commit5e805a59c6c7e1e32292b78853002c9766ac491b (patch)
treeec8af123f1c1b315595268a1d7fc2dc9b3c3e654 /core/src
parent973f85fd0f602b868a90725408507bd99ceb210a (diff)
support chdir for process
Diffstat (limited to 'core/src')
m---------core/src/tbox/tbox0
-rw-r--r--core/src/xmake/process/open.c6
-rw-r--r--core/src/xmake/process/openv.c8
3 files changed, 13 insertions, 1 deletions
diff --git a/core/src/tbox/tbox b/core/src/tbox/tbox
-Subproject 2c18435e5035f29e9393d47dfb5fcd74ef2cea6
+Subproject 015ae373ddefaad1762567575034aa3ca9d459b
diff --git a/core/src/xmake/process/open.c b/core/src/xmake/process/open.c
index 365876047..d027887b7 100644
--- a/core/src/xmake/process/open.c
+++ b/core/src/xmake/process/open.c
@@ -69,6 +69,12 @@ tb_int_t xm_process_open(lua_State* lua)
attr.flags |= TB_PROCESS_FLAG_DETACH;
lua_pop(lua, 1);
+ // get curdir
+ lua_pushstring(lua, "curdir");
+ lua_gettable(lua, 3);
+ attr.curdir = lua_tostring(lua, -1);
+ lua_pop(lua, 1);
+
// get outpath
lua_pushstring(lua, "outpath");
lua_gettable(lua, 2);
diff --git a/core/src/xmake/process/openv.c b/core/src/xmake/process/openv.c
index 4ec2399fc..c81e98d88 100644
--- a/core/src/xmake/process/openv.c
+++ b/core/src/xmake/process/openv.c
@@ -111,6 +111,12 @@ tb_int_t xm_process_openv(lua_State* lua)
attr.flags |= TB_PROCESS_FLAG_DETACH;
lua_pop(lua, 1);
+ // get curdir
+ lua_pushstring(lua, "curdir");
+ lua_gettable(lua, 3);
+ attr.curdir = lua_tostring(lua, -1);
+ lua_pop(lua, 1);
+
// get outpath
lua_pushstring(lua, "outpath");
lua_gettable(lua, 3);
@@ -201,7 +207,7 @@ tb_int_t xm_process_openv(lua_State* lua)
}
lua_pop(lua, 1);
}
-
+
// redirect stdout?
if (outpath)
{