Merge pull request #754 from ferrarimarco/fix-shell-exec-bit

Fix ERROR_ON_MISSING_EXEC_BIT initialization
This commit is contained in:
Lukas Gravley 2020-09-21 08:16:45 -05:00 committed by GitHub
commit ad8ff22250
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 #