Handle attributes and self-closing tags

This commit is contained in:
Niels Geens
2025-04-10 14:35:14 +02:00
parent 5b8f04be81
commit cfb65ee710
32 changed files with 3065 additions and 173 deletions

View File

@@ -162,16 +162,6 @@ process_command() {
output_abs_path=$(realpath -m "$output_file")
output_rel_path=$(realpath --relative-to=. "$output_abs_path")
# Generate directory tree
{
echo "Directory Tree:"
if command -v tree &>/dev/null; then
tree -a -I '.git' .
else
find . -name .git -prune -o -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
fi
} > "$output_file"
# Process directories and collect files
declare -a all_files=()
@@ -262,7 +252,7 @@ process_command() {
# Append file contents to output
{
echo -e "\n\nFile Contents:"
echo -e "File Contents:"
for file in "${unique_files[@]}"; do
if [[ -L "$file" ]]; then
target=$(readlink -f "$file" || echo "unknown")
@@ -272,7 +262,7 @@ process_command() {
cat "$file" 2>/dev/null || echo "Error: Unable to read file"
fi
done
} >> "$output_file"
} > "$output_file"
fi
}