diff options
| author | ruki <[email protected]> | 2022-08-31 22:44:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-31 22:44:25 +0800 |
| commit | 8294b15c930de7df43333dc1e93b019df93a73f8 (patch) | |
| tree | 74a6403a73b9770e57d8ddb78db5a5a5ea09da2d /core/src | |
| parent | 23f93ac88e0484178a37c01b6e33298c95e3b64c (diff) | |
improve os.cp
Diffstat (limited to 'core/src')
| -rw-r--r-- | core/src/xmake/os/cpdir.c | 10 |
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; } |
