summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-01-07 00:38:36 +0800
committerruki <[email protected]>2021-01-07 00:38:36 +0800
commit131105d7fcf17cc25ce3f65e8223706d5387cd0a (patch)
treef73c57f127383efd3f496ea7cb4215d43b036d11
parent5b8aea6d6eb1f2b5290a3bbee585a958a35c4a97 (diff)
git clean all files for packages
-rw-r--r--xmake/actions/require/impl/actions/download.lua4
-rw-r--r--xmake/modules/devel/git/clean.lua5
2 files changed, 7 insertions, 2 deletions
diff --git a/xmake/actions/require/impl/actions/download.lua b/xmake/actions/require/impl/actions/download.lua
index 3db3e2da9..9a6dbbce8 100644
--- a/xmake/actions/require/impl/actions/download.lua
+++ b/xmake/actions/require/impl/actions/download.lua
@@ -40,7 +40,7 @@ function _checkout(package, url, sourcedir, url_alias)
not (option.get("force") and package:branch()) then -- we need disable cache if we force to clone from the given branch
-- clean the previous build files
- git.clean({repodir = packagedir, force = true})
+ git.clean({repodir = packagedir, force = true, all = true})
-- reset the previous modified files
git.reset({repodir = packagedir, hard = true})
tty.erase_line_to_start().cr()
@@ -50,7 +50,7 @@ function _checkout(package, url, sourcedir, url_alias)
-- we can use local package from the search directories directly if network is too slow
local localdir = find_directory(package:name() .. archive.extension(url), core_package.searchdirs())
if localdir and os.isdir(localdir) then
- git.clean({repodir = localdir, force = true})
+ git.clean({repodir = localdir, force = true, all = true})
tty.erase_line_to_start().cr()
return
end
diff --git a/xmake/modules/devel/git/clean.lua b/xmake/modules/devel/git/clean.lua
index 0f6c57e3f..ae21c3d88 100644
--- a/xmake/modules/devel/git/clean.lua
+++ b/xmake/modules/devel/git/clean.lua
@@ -56,6 +56,11 @@ function main(opt)
table.insert(argv, "-f")
end
+ -- remove all files and does not use the standard ignore rules
+ if opt.all then
+ table.insert(argv, "-x")
+ end
+
-- enter repository directory
local oldir = nil
if opt.repodir then