mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-23 07:42:13 -05:00
adding the rest
This commit is contained in:
parent
c41b2aef29
commit
1102675a6d
1 changed files with 5 additions and 24 deletions
|
@ -575,34 +575,15 @@ DetectCloudFormationFile() {
|
||||||
#######################################
|
#######################################
|
||||||
# Check if file has AWS Template info #
|
# Check if file has AWS Template info #
|
||||||
#######################################
|
#######################################
|
||||||
if grep 'AWSTemplateFormatVersion' "${FILE}" > /dev/null; then
|
if grep -q 'AWSTemplateFormatVersion' "${FILE}" > /dev/null; then
|
||||||
# Found it
|
# Found it
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
###################################################
|
#####################################
|
||||||
# Check if file has AWSTemplateFormatVersion info #
|
# See if it contains AWS References #
|
||||||
###################################################
|
#####################################
|
||||||
if shyaml --quiet get-type AWSTemplateFormatVersion > /dev/null < "${FILE}"; then
|
if grep -q -E '(AWS|Alexa|Custom)::' "${FILE}" > /dev/null; then
|
||||||
# Found it
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
###############################
|
|
||||||
# check if file has resources #
|
|
||||||
###############################
|
|
||||||
if jq -e 'has("Resources")' > /dev/null 2>&1 < "${FILE}"; then
|
|
||||||
# Check if AWS Alexa or custom
|
|
||||||
if jq ".Resources[].Type" 2> /dev/null | grep -q -E "(AWS|Alexa|Custom)" < "${FILE}"; then
|
|
||||||
# Found it
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
################################
|
|
||||||
# See if it contains resources #
|
|
||||||
################################
|
|
||||||
if shyaml values-0 Resources 2> /dev/null | grep -q -E "Type: (AWS|Alexa|Custom)" < "${FILE}"; then
|
|
||||||
# Found it
|
# Found it
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue