diff options
| author | ruki <[email protected]> | 2017-02-09 00:05:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-02-09 00:05:54 +0800 |
| commit | 70e0920178003f50a7dac73a6778ecd57df3f803 (patch) | |
| tree | c3fd789a6078d402147689953eabf7b73475b597 | |
| parent | 893ac8653a3c8525dcc7236721ca251d027ad818 (diff) | |
fix emptydir bug
| -rwxr-xr-x | core/src/xmake/os/emptydir.c | 2 | ||||
| -rwxr-xr-x | xmake/actions/build/main.lua | 2 | ||||
| -rwxr-xr-x | xmake/actions/clean/main.lua | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/core/src/xmake/os/emptydir.c b/core/src/xmake/os/emptydir.c index 73746d804..a5f502d2d 100755 --- a/core/src/xmake/os/emptydir.c +++ b/core/src/xmake/os/emptydir.c @@ -71,7 +71,7 @@ tb_int_t xm_os_emptydir(lua_State* lua) // done os.emptydir(dir) tb_bool_t is_emptydir = tb_true; - tb_directory_walk(dir, tb_false, tb_true, xm_os_emptydir_walk, &is_emptydir); + tb_directory_walk(dir, tb_true, tb_true, xm_os_emptydir_walk, &is_emptydir); // is emptydir? lua_pushboolean(lua, is_emptydir); diff --git a/xmake/actions/build/main.lua b/xmake/actions/build/main.lua index 14e73b8f7..3f8dc460d 100755 --- a/xmake/actions/build/main.lua +++ b/xmake/actions/build/main.lua @@ -47,8 +47,10 @@ function main() -- rebuild? if option.get("rebuild") or cache.get("rebuild") then + table.dump(os.match("$(buildir)/**", 'a')) -- clean it first task.run("clean", {target = targetname}) + table.dump(os.match("$(buildir)/**", 'a')) -- reset state cache.set("rebuild", nil) diff --git a/xmake/actions/clean/main.lua b/xmake/actions/clean/main.lua index 3f2d39fa9..d92ff1322 100755 --- a/xmake/actions/clean/main.lua +++ b/xmake/actions/clean/main.lua @@ -42,7 +42,7 @@ function _remove(filedirs) -- remove it if the parent directory is empty local parentdir = path.directory(filedir) while parentdir and os.isdir(parentdir) and os.emptydir(parentdir) do - os.rm(parentdir) + os.tryrm(parentdir) parentdir = path.directory(parentdir) end end |
