summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/xmake/os/cpdir.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/xmake/os/cpdir.c b/core/src/xmake/os/cpdir.c
index 1967cba49..eaf59f445 100644
--- a/core/src/xmake/os/cpdir.c
+++ b/core/src/xmake/os/cpdir.c
@@ -43,9 +43,13 @@ tb_int_t xm_os_cpdir(lua_State* lua)
tb_char_t const* dst = luaL_checkstring(lua, 2);
tb_check_return_val(src && dst, 0);
- // done os.cpdir(src, dst)
- lua_pushboolean(lua, tb_directory_copy(src, dst));
+ // init copy flags
+ tb_size_t flags = TB_FILE_COPY_NONE;
+ tb_bool_t is_symlink = lua_toboolean(lua, 3);
+ if (is_symlink)
+ flags |= TB_FILE_COPY_LINK;
- // ok
+ // do copy
+ lua_pushboolean(lua, tb_directory_copy(src, dst, flags));
return 1;
}