Skip to content
This repository was archived by the owner on Aug 18, 2020. It is now read-only.

Commit 610f10a

Browse files
author
Michael Hueschen
committed
[CDEC-429] Satisfy shellcheck
1 parent e273af6 commit 610f10a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scripts/package-dep-graph.sh

+8-5
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,32 @@ done
5555
# Generate graph
5656
################################################################################
5757

58-
tmpdir=$(mktemp -d "${TMPDIR:-/tmp/}$(basename \"$0\").XXXXXXXXXXXX")
58+
tmpdir=$(mktemp -d "${TMPDIR:-/tmp/}$(basename "$0").XXXXXXXXXXXX")
5959
outfile="cardano-sl-pkg-deps.png"
6060

6161
# 'tred' and 'dot' are in the 'graphviz' of most Linux distributions.
6262

6363
if [ "${include_test_bench}" = "0" ]; then
6464
prunefiles=$(find . -name \*.cabal -exec basename {} \; \
65-
| grep -v stack-work | grep "test.cabal\|bench.cabal" \
65+
| grep -v stack-work | grep "test.cabal\\|bench.cabal" \
6666
| sed 's/\.cabal//' | tr '\n' ',')
6767
stack_dot_flags="${stack_dot_flags} --prune ${prunefiles}"
6868
fi
6969

70-
stack dot ${stack_dot_flags} > "${tmpdir}/full-dependencies.dot"
70+
# This is a weird hack to satisfy shellcheck. While strange, it works, and is
71+
# technically safer.
72+
output="yes"
73+
stack dot ${output:+${stack_dot_flags}} > "${tmpdir}/full-dependencies.dot"
7174

7275
final_dotfile=""
7376
if [ "${use_tred}" = "1" ]; then
7477
final_dotfile="${tmpdir}/direct-dependencies.dot"
75-
tred "${tmpdir}/full-dependencies.dot" > ${final_dotfile}
78+
tred "${tmpdir}/full-dependencies.dot" > "${final_dotfile}"
7679
else
7780
final_dotfile="${tmpdir}/full-dependencies.dot"
7881
fi
7982

80-
dot -Tpng ${final_dotfile} -o ${outfile}
83+
dot -Tpng "${final_dotfile}" -o ${outfile}
8184

8285
rm -rf "${tmpdir:?}/"
8386

0 commit comments

Comments
 (0)