mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 05:23:35 +00:00 
			
		
		
		
	In tools/django-template-graph line 10:
    for t in $(find -name '*.html' -printf '%P\n'); do
             ^-- SC2044: For loops over find output are fragile. Use find -exec or a while read loop.
               ^-- SC2185: Some finds don't have a default path. Specify '.' explicitly.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			469 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			469 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
#!/usr/bin/env bash
 | 
						|
set -e
 | 
						|
 | 
						|
# Draws the Django template inheritance graph.
 | 
						|
 | 
						|
cd "$(dirname "$0")"/../templates
 | 
						|
 | 
						|
(
 | 
						|
    echo 'digraph {'
 | 
						|
    find . -name '*.html' -printf '%P\n' | while read -r t; do
 | 
						|
        echo "\"$t\";" | sed 's|/|\\n|g'
 | 
						|
        perl -lne 'print "\"'"$t"'\" -> \"$1\";" if m/{%\s*extends\s*"([^"]+)"/' "$t" \
 | 
						|
            | sed 's|/|\\n|g'
 | 
						|
    done
 | 
						|
    echo '}'
 | 
						|
) > graph.dot
 | 
						|
 | 
						|
dot -Tsvg graph.dot > graph.svg
 | 
						|
rm graph.dot
 | 
						|
echo file://"$(pwd)"/graph.svg
 |