git @ Cat's Eye Technologies shelf / 90cadf2
Refactor find options. Skip venv (Python virtualenv directory.) Chris Pressey 6 years ago
1 changed file(s) with 16 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4848 _shelf_link_stuff() {
4949 dir="$1"
5050 subdir="$2"
51 find_opts="-name .git -prune -o -path Funicular/eg -prune -o -path Chrysoberyl/modules -prune -o -path Chrysoberyl/checkout -prune -o $3"
51
52 exclude_dirs=".git .hg venv"
53 exclude_paths="Funicular/eg Chrysoberyl/modules Chrysoberyl/checkout"
54 find_opts=""
55 for ed in $exclude_dirs; do
56 find_opts="$find_opts -name $ed -prune -o "
57 done
58 for ep in $exclude_paths; do
59 find_opts="$find_opts -path $ep -prune -o "
60 done
61 find_opts="$find_opts $3"
62 _shelf_verbose "Find-opts: <<$find_opts>>"
63
5264 if [ "X$dir" = X ]; then
5365 echo "Usage: _shelf_link_stuff <dir> <subdir> <find-opts>"
5466 return 1
5870 base=`basename "$source"`
5971 if [ "X$subdir" = "Xbin" ]; then
6072 case "$base" in
61 *.jpg|*.png|.git|.hg|depcomp|configure|config.guess|*.h|*.so|*.so.*)
73 *.jpg|*.png|.git|.hg|venv|depcomp|configure|config.guess|*.h|*.so|*.so.*)
6274 _shelf_verbose Skipping $base
6375 ;;
6476 *)
6779 esac
6880 elif [ "X$subdir" = "Xinclude" ]; then
6981 case "$base" in
70 *.jpg|*.png|.git|.hg)
82 *.jpg|*.png|.git|.hg|venv)
7183 _shelf_verbose Skipping $base
7284 ;;
7385 *)
7688 esac
7789 elif [ "X$subdir" = "Xlib" ]; then
7890 case "$base" in
79 *.jpg|*.png|.git|.hg)
91 *.jpg|*.png|.git|.hg|venv)
8092 _shelf_verbose Skipping $base
8193 ;;
8294 *)