This repository was archived by the owner on Aug 18, 2020. It is now read-only.
File tree 1 file changed +8
-5
lines changed
1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 55
55
# Generate graph
56
56
# ###############################################################################
57
57
58
- tmpdir=$( mktemp -d " ${TMPDIR:-/ tmp/ } $( basename \ "$0 \ ") .XXXXXXXXXXXX" )
58
+ tmpdir=$( mktemp -d " ${TMPDIR:-/ tmp/ } $( basename " $0 " ) .XXXXXXXXXXXX" )
59
59
outfile=" cardano-sl-pkg-deps.png"
60
60
61
61
# 'tred' and 'dot' are in the 'graphviz' of most Linux distributions.
62
62
63
63
if [ " ${include_test_bench} " = " 0" ]; then
64
64
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" \
66
66
| sed ' s/\.cabal//' | tr ' \n' ' ,' )
67
67
stack_dot_flags=" ${stack_dot_flags} --prune ${prunefiles} "
68
68
fi
69
69
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"
71
74
72
75
final_dotfile=" "
73
76
if [ " ${use_tred} " = " 1" ]; then
74
77
final_dotfile=" ${tmpdir} /direct-dependencies.dot"
75
- tred " ${tmpdir} /full-dependencies.dot" > ${final_dotfile}
78
+ tred " ${tmpdir} /full-dependencies.dot" > " ${final_dotfile} "
76
79
else
77
80
final_dotfile=" ${tmpdir} /full-dependencies.dot"
78
81
fi
79
82
80
- dot -Tpng ${final_dotfile} -o ${outfile}
83
+ dot -Tpng " ${final_dotfile} " -o ${outfile}
81
84
82
85
rm -rf " ${tmpdir:? } /"
83
86
You can’t perform that action at this time.
0 commit comments