terraform-get-targets: Report errors to stderr

This commit is contained in:
2025-01-16 12:06:13 +01:00
parent b7fc0c6e3d
commit 38448a8194

View File

@@ -11,7 +11,7 @@ do
RESOURCE=$(sed -n 's/^resource "\([^"]*\)" "\([^"]*\)".*/-target=\1.\2 /gp' "$FILE")
MODULE=$(sed -n 's/^module "\([^"]*\)".*/-target=module.\1 /gp' "$FILE")
if [[ -z "$RESOURCE" ]] && [[ -z "$MODULE" ]]; then
echo "Cannot detect terraform resource and module in $FILE"
echo "Cannot detect terraform resource and module in $FILE" >&2
exit 1
fi