Initial commit of zrep

This commit is contained in:
2024-02-27 16:50:07 +01:00
parent 08e19f9abf
commit 41f0709722
3 changed files with 142 additions and 0 deletions

16
functions/zrep_fpath Normal file
View File

@ -0,0 +1,16 @@
function zrep_fpath() {
local base_dir="$1"
# Check if the base directory exists
if [[ ! -d "$base_dir" ]]; then
echo "Error: Base directory '$base_dir' does not exist."
return 1
fi
# Add directories containing at least one file to fpath
for dir in $base_dir/**/*(/N); do
if [[ -n $(ls -A "$dir") ]]; then
fpath=($dir $fpath)
fi
done
}