From 7f35ad916e8aac4a2c94eac340494d54071a1eb0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Fri, 3 Aug 2018 00:14:49 +0000 Subject: [PATCH] django-template-graph: Fix shellcheck warnings. 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 --- tools/django-template-graph | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/django-template-graph b/tools/django-template-graph index 02dee5a682..a6b318f0f8 100755 --- a/tools/django-template-graph +++ b/tools/django-template-graph @@ -7,7 +7,7 @@ cd "$(dirname "$0")"/../templates ( echo 'digraph {' - for t in $(find -name '*.html' -printf '%P\n'); do + 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'