forked from antonbabenko/pre-commit-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
110 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env bash | ||
set -eo pipefail | ||
|
||
# shellcheck disable=SC2155 # No way to assign to readonly variable in separate lines | ||
readonly SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" | ||
# shellcheck source=_common.sh | ||
source "$SCRIPT_DIR/_common.sh" | ||
|
||
function main { | ||
common::initialize "$SCRIPT_DIR" | ||
tfupdate_ "$@" | ||
} | ||
|
||
####################################################################### | ||
# tfupdate_ | ||
####################################################################### | ||
function tfupdate_ { | ||
local -r args=$* | ||
# pass the arguments to hook | ||
# shellcheck disable=SC2086 # Double quote to prevent globbing and word splitting. | ||
tfupdate ${args} --recursive . | ||
local exit_code=$? | ||
return $exit_code | ||
} | ||
|
||
[ "${BASH_SOURCE[0]}" != "$0" ] || main "$@" |