diff options
| author | ruki <[email protected]> | 2020-08-29 11:35:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-08-29 11:35:41 +0800 |
| commit | 264e211862a2356c5928a4a75b6da90056d40057 (patch) | |
| tree | 8f8eee51bbc28451550c81b767dddb54b1f9495d /xmake/plugins/project/make/makefile.lua | |
| parent | 00b0c1607426b0d9c1fc654aad3e33e416d80010 (diff) | |
fix makefile/clean
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
| -rw-r--r-- | xmake/plugins/project/make/makefile.lua | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua index 02deeb3f9..b74184318 100644 --- a/xmake/plugins/project/make/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua @@ -51,20 +51,11 @@ end -- try to remove the given file or directory function _tryrm(makefile, filedir) - - -- remove it if is_plat("windows") then - if os.isdir(filedir) then - makefile:print("\t@rmdir /S /Q %s > NUL 2>&1", filedir) - elseif os.isfile(filedir) then - makefile:print("\t@del /F /Q %s > NUL 2>&1", filedir) - end + -- we attempt to delete it as file first, we remove it as directory if failed + makefile:print("\t@del /F /Q %s > NUL 2>&1 || rmdir /S /Q %s > NUL 2>&1", filedir, filedir) else - if os.isdir(filedir) then - makefile:print("\t@rm -rf %s", filedir) - elseif os.isfile(filedir) then - makefile:print("\t@rm -f %s", filedir) - end + makefile:print("\t@rm -rf %s", filedir) end end |
