logo

deblob

remove binary executables from a directory git clone https://hacktivis.me/git/deblob.git
commit: 73ef3d3bfc1d8ef309008781f0d06194f63afdeb
parent 6f87951b936740960debca1c7ed8433e0364e2a7
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Mon, 21 Feb 2022 00:38:47 +0100

Ignore non-(dir/regular-file)

Diffstat:

Mmain.ha5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/main.ha b/main.ha @@ -102,7 +102,7 @@ fn check_dir(dirname: str, ignoring: bool) (ok|invalid) = { match(check_dir(filename, ignoring)) { case => continue; }; - } else { + } else if(fs::isfile(file.ftype)) { let is_blob = match(is_blob(filename)) { case let b: bool => yield b; case invalid => continue; @@ -129,6 +129,9 @@ fn check_dir(dirname: str, ignoring: bool) (ok|invalid) = { case let e: fs::error => fmt::errorf("os::remove({}): {}\n", filename, fs::strerror(e))!; }; + } else { + // ignore non-(dir/regular-file) like symlinks, blocks, fifo, … + continue; }; };