Fix ERROR_ON_MISSING_EXEC_BIT initialization

This commit is contained in:
Marco Ferrari 2020-09-21 14:43:44 +02:00
parent 87db6105ed
commit 6168112f61
2 changed files with 2 additions and 1 deletions

View file

@ -257,7 +257,7 @@ DEFAULT_IFS="${IFS}" # Get the Default IFS for up
###############################################################
DEFAULT_DISABLE_ERRORS='false' # Default to enabling errors
export DEFAULT_DISABLE_ERRORS # Workaround SC2034
ERROR_ON_MISSING_EXEC_BIT='false' # Default to report a warning if a shell script doesn't have the executable bit set to 1
ERROR_ON_MISSING_EXEC_BIT="${ERROR_ON_MISSING_EXEC_BIT:-false}" # Default to report a warning if a shell script doesn't have the executable bit set to 1
export ERROR_ON_MISSING_EXEC_BIT
RAW_FILE_ARRAY=() # Array of all files that were changed
export RAW_FILE_ARRAY # Workaround SC2034

View file

@ -297,6 +297,7 @@ function LintCodebase() {
# Check the shell for errors #
##############################
if [ ${ERROR_CODE} -ne 0 ]; then
debug "Found errors. Error code: ${ERROR_CODE}, File type: ${FILE_TYPE}, Error on missing exec bit: ${ERROR_ON_MISSING_EXEC_BIT}"
if [[ ${FILE_TYPE} == "BASH_EXEC" ]] && [[ "${ERROR_ON_MISSING_EXEC_BIT}" == "false" ]]; then
########
# WARN #