Jack000 / Expose

A simple static site generator for photoessays
MIT License
4.39k stars 257 forks source link

Ignore hidden folder (e.g. .git folder) #51

Open marcolussetti opened 2 years ago

marcolussetti commented 2 years ago

This addresses #26 which I think is very nice for those who want to keep the photos and metadata in their own Git repository.

tmountain commented 1 year ago

This should be merged because a .git folder can cause a recursive situation to occur where expose never finishes...

tmountain commented 1 year ago

I applied this manually and can confirm it fixes the recursion bug when using git.

krupan commented 1 year ago

I strongly agree this is needed. This might be a better way to do it (puts it in the same place that directories starting wtih _ are handled/ignored):

diff --git a/expose.sh b/expose.sh
index 3aa8d3d..80ac6f5 100755
--- a/expose.sh
+++ b/expose.sh
@@ -239,7 +239,7 @@ do
        nav_name+=("$node_name")
        nav_depth+=("$node_depth")
        nav_type+=("$node_type")
-done < <(find "$topdir" -type d ! -path "$topdir*/_*" | sort)
+done < <(find "$topdir" -type d ! -path "$topdir*/_*" ! -path "$topdir*/.*" | sort)

 # re-create directory structure
 mkdir -p "$topdir/_site"