updated to emit dot directories and files.
[feisty_meow.git] / scripts / buildor / find_in_code.sh
index 23d7cb08fe618406675f43bd697e93e5bdb4ffb5..453cfa2da95d854fc26cb99ce17a8c541aad4f25 100644 (file)
@@ -6,8 +6,14 @@ if [ -z "$seek" ]; then
   echo pattern.
   exit 1
 fi
+#hmmm: might be nice to support multiple directories...
+#      just need to pass them to find as an array maybe?
+dir="$1"; shift
+if [ -z "$dir" ]; then
+  dir=.
+fi
 
-find . -type f \( -iname "*" \
+find "$dir" -type f \( -iname "*" \
   ! -iname "*.class" \
   ! -iname "*.dll" \
   ! -iname "*.exe" \
@@ -20,5 +26,8 @@ find . -type f \( -iname "*" \
   ! -iname "*.svn" \
   ! -iname "*.svn-base" \
   ! -iname "*.tar" \
+  ! -iname "*.tmp" \
   ! -iname "*.zip" \) \
-  -exec echo "\"{}\"" ';' | xargs grep -li "$seek" 
+  -exec echo "\"{}\"" ';' | xargs grep -li "$seek" | grep -v "^\.\|\/\."
+
+