superlint/lib/buildFileList.sh

530 lines
21 KiB
Bash
Raw Normal View History

2020-06-29 10:55:59 -04:00
#!/usr/bin/env bash
################################################################################
################################################################################
########### Super-Linter Build File List Functions @admiralawkbar ##############
################################################################################
################################################################################
########################## FUNCTION CALLS BELOW ################################
################################################################################
################################################################################
#### Function BuildFileList ####################################################
2020-07-01 17:40:40 -04:00
function BuildFileList() {
2020-06-29 10:55:59 -04:00
# Need to build a list of all files changed
# This can be pulled from the GITHUB_EVENT_PATH payload
################
# print header #
################
2020-07-21 13:09:07 -04:00
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
2020-06-29 10:55:59 -04:00
echo ""
echo "----------------------------------------------"
echo "Pulling in code history and branches..."
fi
#################################################################################
# Switch codebase back to the default branch to get a list of all files changed #
#################################################################################
2020-07-01 17:40:40 -04:00
SWITCH_CMD=$(
2020-07-21 13:09:07 -04:00
git -C "${GITHUB_WORKSPACE}" pull --quiet
git -C "${GITHUB_WORKSPACE}" checkout "${DEFAULT_BRANCH}" 2>&1
2020-07-01 17:40:40 -04:00
)
2020-06-29 10:55:59 -04:00
#######################
# Load the error code #
#######################
ERROR_CODE=$?
##############################
# Check the shell for errors #
##############################
2020-07-21 13:09:07 -04:00
if [ ${ERROR_CODE} -ne 0 ]; then
2020-06-29 10:55:59 -04:00
# Error
2020-07-21 13:09:07 -04:00
echo "Failed to switch to ${DEFAULT_BRANCH} branch to get files changed!"
echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${SWITCH_CMD}]${NC}"
2020-06-29 10:55:59 -04:00
exit 1
fi
################
# print header #
################
2020-07-21 13:09:07 -04:00
if [[ ${ACTIONS_RUNNER_DEBUG} == "true" ]]; then
2020-06-29 10:55:59 -04:00
echo ""
echo "----------------------------------------------"
2020-07-21 13:09:07 -04:00
echo "Generating Diff with:[git diff --name-only '${DEFAULT_BRANCH}..${GITHUB_SHA}' --diff-filter=d]"
2020-06-29 10:55:59 -04:00
fi
#################################################
# Get the Array of files changed in the commits #
#################################################
2020-07-21 13:09:07 -04:00
mapfile -t RAW_FILE_ARRAY < <(git -C "${GITHUB_WORKSPACE}" diff --name-only "${DEFAULT_BRANCH}..${GITHUB_SHA}" --diff-filter=d 2>&1)
2020-06-29 10:55:59 -04:00
#######################
# Load the error code #
#######################
ERROR_CODE=$?
##############################
# Check the shell for errors #
##############################
2020-07-21 13:09:07 -04:00
if [ ${ERROR_CODE} -ne 0 ]; then
2020-06-29 10:55:59 -04:00
# Error
2020-07-01 16:47:24 -04:00
echo -e "${NC}${B[R]}${F[W]}ERROR!${NC} Failed to gain a list of all files changed!${NC}"
echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${RAW_FILE_ARRAY[*]}]${NC}"
2020-06-29 10:55:59 -04:00
exit 1
fi
################################################
# Iterate through the array of all files found #
################################################
echo ""
echo "----------------------------------------------"
echo "Files that have been modified in the commit(s):"
2020-07-01 17:40:40 -04:00
for FILE in "${RAW_FILE_ARRAY[@]}"; do
2020-06-29 10:55:59 -04:00
###########################
# Get the files extension #
###########################
# Extract just the file and extension, reverse it, cut off extension,
# reverse it back, substitute to lowercase
2020-07-21 21:17:51 -04:00
FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}')
2020-06-29 10:55:59 -04:00
2020-07-06 09:29:36 -04:00
##############
# Print file #
##############
2020-07-21 13:09:07 -04:00
echo "File:[${FILE}], File_type:[${FILE_TYPE}]"
2020-07-06 09:29:36 -04:00
2020-06-29 10:55:59 -04:00
#########
# DEBUG #
#########
2020-07-21 13:09:07 -04:00
#echo "FILE_TYPE:[${FILE_TYPE}]"
2020-06-29 10:55:59 -04:00
#####################
2020-06-29 15:38:24 -04:00
# Get the CFN files #
2020-06-29 10:55:59 -04:00
#####################
2020-07-21 13:09:07 -04:00
if [ "${FILE_TYPE}" == "yml" ] || [ "${FILE_TYPE}" == "yaml" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_YML+=("${FILE}")
2020-06-29 15:38:24 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
#####################################
# Check if the file is CFN template #
#####################################
2020-07-21 13:09:07 -04:00
if DetectCloudFormationFile "${FILE}"; then
2020-06-29 15:38:24 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_CFN+=("${FILE}")
2020-07-01 12:59:00 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-06-29 10:55:59 -04:00
fi
######################
# Get the JSON files #
######################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "json" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_JSON+=("${FILE}")
2020-06-29 10:55:59 -04:00
############################
# Check if file is OpenAPI #
############################
2020-07-21 13:09:07 -04:00
if DetectOpenAPIFile "${FILE}"; then
2020-06-29 15:38:24 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_OPENAPI+=("${FILE}")
2020-06-29 10:55:59 -04:00
fi
2020-07-02 17:31:16 -04:00
############################
# Check if file is ARM #
############################
2020-07-21 13:09:07 -04:00
if DetectARMFile "${FILE}"; then
2020-07-02 17:31:16 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_ARM+=("${FILE}")
2020-07-02 17:31:16 -04:00
fi
2020-06-29 15:38:24 -04:00
#####################################
# Check if the file is CFN template #
#####################################
2020-07-21 13:09:07 -04:00
if DetectCloudFormationFile "${FILE}"; then
2020-06-29 15:38:24 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_CFN+=("${FILE}")
2020-06-29 15:38:24 -04:00
fi
2020-07-21 14:50:04 -04:00
############################################
# Check if the file is AWS States Language #
############################################
2020-07-21 15:39:14 -04:00
if DetectAWSStatesFIle "${FILE}"; then
2020-07-21 14:50:04 -04:00
################################
# Append the file to the array #
################################
2020-07-21 15:39:14 -04:00
FILE_ARRAY_STATES+=("${FILE}")
2020-06-29 15:38:24 -04:00
fi
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
#####################
# Get the XML files #
#####################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "xml" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_XML+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
##########################
# Get the MARKDOWN files #
##########################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "md" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_MARKDOWN+=("${FILE}")
2020-06-29 10:55:59 -04:00
######################
# Get the BASH files #
######################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "sh" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_BASH+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
######################
# Get the PERL files #
######################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "pl" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_PERL+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
2020-07-05 22:21:13 -04:00
READ_ONLY_CHANGE_FLAG=1
######################
# Get the RAKU files #
######################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "raku" ] || [ "${FILE_TYPE}" == "rakumod" ] \
|| [ "${FILE_TYPE}" == "rakutest" ] || [ "${FILE_TYPE}" == "pm6" ] \
|| [ "${FILE_TYPE}" == "pl6" ] || [ "${FILE_TYPE}" == "p6" ] ; then
2020-07-05 22:21:13 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_RAKU+=("${FILE}")
2020-07-05 22:21:13 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
2020-06-29 10:55:59 -04:00
READ_ONLY_CHANGE_FLAG=1
######################
# Get the PHP files #
######################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "php" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_PHP+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
######################
# Get the RUBY files #
######################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "rb" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_RUBY+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
########################
# Get the PYTHON files #
########################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "py" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_PYTHON+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
########################
# Get the COFFEE files #
########################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "coffee" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_COFFEESCRIPT+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
############################
# Get the JavaScript files #
############################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "js" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_JAVASCRIPT_ES+=("${FILE}")
FILE_ARRAY_JAVASCRIPT_STANDARD+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
############################
2020-07-07 11:02:56 -04:00
# Get the JSX files #
############################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "jsx" ]; then
2020-07-07 11:02:56 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_JSX+=("${FILE}")
2020-07-07 11:02:56 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
############################
# Get the TSX files #
############################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "tsx" ]; then
2020-07-07 11:02:56 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_TSX+=("${FILE}")
2020-07-07 11:02:56 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
########################
# Get the Golang files #
########################
############################
2020-06-29 10:55:59 -04:00
# Get the TypeScript files #
############################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "ts" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_TYPESCRIPT_ES+=("${FILE}")
FILE_ARRAY_TYPESCRIPT_STANDARD+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
########################
# Get the Golang files #
########################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "go" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_GO+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
###########################
# Get the Terraform files #
###########################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "tf" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_TERRAFORM+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
###########################
# Get the Powershell files #
###########################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "ps1" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_POWERSHELL+=("${FILE}")
elif [ "${FILE_TYPE}" == "css" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_CSS+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "env" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_ENV+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "kt" ] || [ "${FILE_TYPE}" == "kts" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_KOTLIN+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
############################
# Get the Protocol Buffers files #
############################
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "dart" ]; then
2020-07-06 04:17:20 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_DART+=("${FILE}")
2020-07-06 04:17:20 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "proto" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_PROTOBUF+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [ "${FILE}" == "dockerfile" ] || [ "${FILE_TYPE}" == "dockerfile" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_DOCKER+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "clj" ] || [ "${FILE_TYPE}" == "cljs" ] || [ "${FILE_TYPE}" == "cljc" ] || [ "${FILE_TYPE}" == "edn" ]; then
2020-06-29 10:55:59 -04:00
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_CLOJURE+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
2020-07-04 18:14:27 -04:00
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [ "${FILE_TYPE}" == "html" ]; then
2020-07-04 18:14:27 -04:00
################################
# Append the file to the array #
##############################p##
2020-07-21 13:09:07 -04:00
FILE_ARRAY_HTML+=("${FILE}")
2020-07-04 18:14:27 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
2020-07-14 10:28:58 -04:00
READ_ONLY_CHANGE_FLAG=1
2020-07-23 09:22:30 -04:00
elif [ "$FILE_TYPE" == "groovy" ] || [ "$FILE_TYPE" == "jenkinsfile" ] || [ "$FILE_TYPE" == "gradle" ]; then
2020-07-14 10:28:58 -04:00
################################
# Append the file to the array #
################################
FILE_ARRAY_GROOVY+=("$FILE")
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
2020-06-29 10:55:59 -04:00
READ_ONLY_CHANGE_FLAG=1
else
##############################################
# Use file to see if we can parse what it is #
##############################################
2020-07-21 13:09:07 -04:00
GET_FILE_TYPE_CMD=$(file "${FILE}" 2>&1)
2020-06-29 10:55:59 -04:00
#################
# Check if bash #
#################
2020-07-21 13:09:07 -04:00
if [[ ${GET_FILE_TYPE_CMD} == *"Bourne-Again shell script"* ]]; then
2020-06-29 10:55:59 -04:00
#######################
# It is a bash script #
#######################
2020-07-01 16:47:24 -04:00
echo -e "${NC}${F[Y]}WARN!${NC} Found bash script without extension:[.sh]${NC}"
2020-06-29 10:55:59 -04:00
echo "Please update file with proper extensions."
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_BASH+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
2020-07-21 13:09:07 -04:00
elif [[ ${GET_FILE_TYPE_CMD} == *"Ruby script"* ]]; then
2020-06-29 10:55:59 -04:00
#######################
# It is a Ruby script #
#######################
2020-07-01 16:47:24 -04:00
echo -e "${NC}${F[Y]}WARN!${NC} Found ruby script without extension:[.rb]${NC}"
2020-06-29 10:55:59 -04:00
echo "Please update file with proper extensions."
################################
# Append the file to the array #
################################
2020-07-21 13:09:07 -04:00
FILE_ARRAY_RUBY+=("${FILE}")
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
else
############################
# Extension was not found! #
############################
2020-07-21 13:09:07 -04:00
echo -e "${NC}${F[Y]} - WARN!${NC} Failed to get filetype for:[${FILE}]!${NC}"
2020-06-29 10:55:59 -04:00
##########################################################
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
##########################################################
READ_ONLY_CHANGE_FLAG=1
fi
fi
done
2020-07-01 17:40:40 -04:00
echo ${READ_ONLY_CHANGE_FLAG} > /dev/null 2>&1 || true # Workaround SC2034
2020-06-29 10:55:59 -04:00
#########################################
# Need to switch back to branch of code #
#########################################
2020-07-21 13:09:07 -04:00
SWITCH2_CMD=$(git -C "${GITHUB_WORKSPACE}" checkout --progress --force "${GITHUB_SHA}" 2>&1)
2020-06-29 10:55:59 -04:00
#######################
# Load the error code #
#######################
ERROR_CODE=$?
##############################
# Check the shell for errors #
##############################
2020-07-21 13:09:07 -04:00
if [ ${ERROR_CODE} -ne 0 ]; then
2020-06-29 10:55:59 -04:00
# Error
echo "Failed to switch back to branch!"
2020-07-21 13:09:07 -04:00
echo -e "${NC}${B[R]}${F[W]}ERROR:${NC}[${SWITCH2_CMD}]${NC}"
2020-06-29 10:55:59 -04:00
exit 1
fi
################
# Footer print #
################
echo ""
echo "----------------------------------------------"
2020-07-01 15:28:32 -04:00
echo -e "${NC}${F[B]}Successfully gathered list of files...${NC}"
2020-06-29 10:55:59 -04:00
}