Last active
January 6, 2022 01:24
-
-
Save joemiller/ba84c2d615c0b4998466d43a64c9dce7 to your computer and use it in GitHub Desktop.
terragrunt wrapper to leverage bash/zsh shell globbing support for the run-all command set
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
#!/bin/bash | |
# | |
# uber simple wrapper to leverage bash/zsh shell globbing support with terragrunt's `--terragrunt-include-dir=` flag. | |
set -eou pipefail | |
[[ -n "${DEBUG:-}" ]] && set -x | |
if [[ "$#" -lt 2 ]]; then | |
echo "Usage: $0 [init|plan|apply] GLOB" | |
exit 1 | |
fi | |
cmd="$1" | |
shift | |
glob=("$@") | |
exec terragrunt run-all "$cmd" --terragrunt-log-level=info "${glob[@]/#/--terragrunt-include-dir=}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment