Skip to content

Commit b273235

Browse files
committed
Re-add run_hook_on_whole_repo
1 parent 5cf8772 commit b273235

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

hooks/terraform_graph.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,20 @@ function per_dir_hook_unique_part {
7171
return $exit_code
7272
}
7373

74+
# Arguments:
75+
# args (array) arguments that configure wrapped tool behavior
76+
#######################################################################
77+
function run_hook_on_whole_repo {
78+
local -a -r args=("$@")
79+
local text_file="graph.svg"
80+
81+
# pass the arguments to hook
82+
echo "${args[@]}" >> run_hook_on_whole_repo
83+
terraform graph "$(pwd)" "${args[@]}" | dot -Tsvg > "$text_file"
84+
85+
# return exit code to common::per_dir_hook
86+
local exit_code=$?
87+
return $exit_code
88+
}
89+
7490
[ "${BASH_SOURCE[0]}" != "$0" ] || main "$@"

0 commit comments

Comments
 (0)