mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 12:42:09 -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 #
|
||||
#######################################
|
||||
if grep 'AWSTemplateFormatVersion' "${FILE}" > /dev/null; then
|
||||
if grep -q 'AWSTemplateFormatVersion' "${FILE}" > /dev/null; then
|
||||
# Found it
|
||||
return 0
|
||||
fi
|
||||
|
||||
###################################################
|
||||
# Check if file has AWSTemplateFormatVersion info #
|
||||
###################################################
|
||||
if shyaml --quiet get-type AWSTemplateFormatVersion > /dev/null < "${FILE}"; 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
|
||||
#####################################
|
||||
# See if it contains AWS References #
|
||||
#####################################
|
||||
if grep -q -E '(AWS|Alexa|Custom)::' "${FILE}" > /dev/null; then
|
||||
# Found it
|
||||
return 0
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue