Explorar el Código

fix(zsh): improve directory copy script

Joe hace 5 meses
padre
commit
1f43c7d626
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5 3
      .config/zsh/.zshrc

+ 5 - 3
.config/zsh/.zshrc

@@ -177,9 +177,11 @@ copy_dir_llm_style () {
             echo "Here is the contents of \`$(basename "$PWD")/\`:\n";
             git ls-files -z |
                 while IFS= read -r -d $'\0' f; do
-                    echo "$f"; echo '```';
-                    cat "$f"; echo '```';
-                    echo;
+                    if [[ "$(file -b --mime-type "$f")" == "text/"* ]]; then
+                        echo "$f"; echo '```';
+                        cat "$f"; echo '```';
+                        echo;
+                    fi
                 done;
         } | pbcopy
         echo "\nCopied!"