don't list empty * file
This commit is contained in:
parent
454af0603a
commit
41e89d4de5
1 changed files with 14 additions and 11 deletions
|
@ -7,13 +7,15 @@ create_ls_entry () {
|
|||
if [ "$1" != "" ]; then
|
||||
echo "- [[$2$1..][=../=]]" >> index.org
|
||||
fi
|
||||
find -L -- . -maxdepth 1 -type d | sed '/^\.$/d' | sed 's/^\.\///' | while read -r dir; do
|
||||
find -L -- . -maxdepth 1 -type d | sed '/^\.$/d' | sed 's/^\.\///' | sort | while read -r dir; do
|
||||
if [ "$dir" != "*" ] && [ "$dir" != ".git" ]; then
|
||||
echo "- [[$2$1$dir][=$dir/=]]" >> index.org
|
||||
fi
|
||||
done
|
||||
echo "* Files" >> index.org
|
||||
find -L -- . -maxdepth 1 -type f | sed 's/^\.\///' | while read -r file; do
|
||||
files=$(find -L -- . -maxdepth 1 -type f | sed 's/^\.\///')
|
||||
if [ "$(echo "$files" | wc -l | sed 's/[ \t]*//g')" != 0 ]; then
|
||||
echo '* Files' >> index.org
|
||||
echo "$files" | sort | while read -r file; do
|
||||
if [ "$file" = ".wallpaper" ]; then
|
||||
echo "- [[https://wallhaven.cc/w/vgryy5][=.wallpaper=]]" >> index.org
|
||||
elif echo "$file" | grep -q "\.org$" && [ "$file" != "index.org" ]; then
|
||||
|
@ -22,6 +24,7 @@ create_ls_entry () {
|
|||
echo "- [[$2$1$html][=$new_file=]]" >> index.org
|
||||
fi
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
create_dir_tree () {
|
||||
|
|
Loading…
Add table
Reference in a new issue