mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 06:01:05 -05:00
saved the world
This commit is contained in:
parent
b83490fc43
commit
2a162c85ab
2 changed files with 72 additions and 2 deletions
|
@ -192,6 +192,66 @@ RenameTestFolder() {
|
|||
fi
|
||||
}
|
||||
################################################################################
|
||||
#### Function CleanPowershell ##################################################
|
||||
CleanPowershell() {
|
||||
# Need to remove the .psd1 templates as they are formally parsed,
|
||||
# and will fail with missing modules
|
||||
|
||||
info "-------------------------------------------------------"
|
||||
info "Finding powershell template files... and removing them..."
|
||||
|
||||
##################
|
||||
# Find the files #
|
||||
##################
|
||||
mapfile -t FIND_CMD < <(cd "${GITHUB_WORKSPACE}" || exit 1 ; find "${GITHUB_WORKSPACE}" -type f -name "*.psd1" 2>&1)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
#######################
|
||||
ERROR_CODE=$?
|
||||
|
||||
##############################
|
||||
# Check the shell for errors #
|
||||
##############################
|
||||
if [ $ERROR_CODE -ne 0 ]; then
|
||||
error "ERROR! failed to get list of all file for *.psd1!"
|
||||
fatal "ERROR:[${FIND_CMD[*]}]"
|
||||
fi
|
||||
|
||||
############################################################
|
||||
# Get the directory and validate it came from tests folder #
|
||||
############################################################
|
||||
for FILE in "${FIND_CMD[@]}"; do
|
||||
#####################
|
||||
# Get the directory #
|
||||
#####################
|
||||
FILE_DIR=$(dirname "$FILE" 2>&1)
|
||||
|
||||
##################################
|
||||
# Check if from the tests folder #
|
||||
##################################
|
||||
if [[ $FILE_DIR == **"TEMPLATES"** ]]; then
|
||||
################################
|
||||
# Its a test, we can delete it #
|
||||
################################
|
||||
REMOVE_FILE_CMD=$(cd "${GITHUB_WORKSPACE}" || exit 1; rm -f "$FILE" 2>&1)
|
||||
|
||||
#######################
|
||||
# Load the error code #
|
||||
#######################
|
||||
ERROR_CODE=$?
|
||||
|
||||
##############################
|
||||
# Check the shell for errors #
|
||||
##############################
|
||||
if [ $ERROR_CODE -ne 0 ]; then
|
||||
error "ERROR! failed to remove file:[${FILE}]!"
|
||||
fatal "ERROR:[${REMOVE_FILE_CMD[*]}]"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
################################################################################
|
||||
################################## MAIN ########################################
|
||||
################################################################################
|
||||
|
||||
|
@ -219,3 +279,8 @@ CleanSHAFolder
|
|||
# Re Name folder #
|
||||
##################
|
||||
RenameTestFolder
|
||||
|
||||
##############################
|
||||
# Clean Powershell templates #
|
||||
##############################
|
||||
CleanPowershell
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
resource "aws_instance" "good" {
|
||||
ami = "ami-0ff8a91507f77f867"
|
||||
instance_type = "t2.small"
|
||||
ami = "ami-0ff8a91507f77f867"
|
||||
instance_type = "t2.small"
|
||||
associate_public_ip_address = false
|
||||
|
||||
ebs_block_device {
|
||||
encrypted = true
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue