mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-09 18:43:34 -05:00
Merge pull request #77 from github/AddFileTypeDetection
Add detection of bash and ruby
This commit is contained in:
commit
f574470c2f
2 changed files with 47 additions and 9 deletions
|
@ -22,7 +22,7 @@ LABEL com.github.actions.name="GitHub Super-Linter" \
|
|||
# Run APK installs #
|
||||
####################
|
||||
RUN apk add --no-cache \
|
||||
bash git git-lfs musl-dev curl gcc jq \
|
||||
bash git git-lfs musl-dev curl gcc jq file\
|
||||
npm nodejs \
|
||||
libxml2-utils perl \
|
||||
ruby ruby-dev ruby-bundler ruby-rdoc make \
|
||||
|
|
|
@ -1221,14 +1221,52 @@ BuildFileList()
|
|||
##########################################################
|
||||
READ_ONLY_CHANGE_FLAG=1
|
||||
else
|
||||
############################
|
||||
# Extension was not found! #
|
||||
############################
|
||||
echo " - WARN! Failed to get filetype for:[$FILE]!"
|
||||
##########################################################
|
||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||
##########################################################
|
||||
READ_ONLY_CHANGE_FLAG=1
|
||||
##############################################
|
||||
# Use file to see if we can parse what it is #
|
||||
##############################################
|
||||
GET_FILE_TYPE_CMD=$(file "$FILE" 2>&1)
|
||||
|
||||
#################
|
||||
# Check if bash #
|
||||
#################
|
||||
if [[ "$GET_FILE_TYPE_CMD" == *"Bourne-Again shell script"* ]]; then
|
||||
#######################
|
||||
# It is a bash script #
|
||||
#######################
|
||||
echo "WARN! Found bash script without extension:[.sh]"
|
||||
echo "Please update file with proper extensions."
|
||||
################################
|
||||
# Append the file to the array #
|
||||
################################
|
||||
FILE_ARRAY_BASH+=("$FILE")
|
||||
##########################################################
|
||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||
##########################################################
|
||||
READ_ONLY_CHANGE_FLAG=1
|
||||
elif [[ "$GET_FILE_TYPE_CMD" == *"Ruby script"* ]]; then
|
||||
#######################
|
||||
# It is a Ruby script #
|
||||
#######################
|
||||
echo "WARN! Found ruby script without extension:[.rb]"
|
||||
echo "Please update file with proper extensions."
|
||||
################################
|
||||
# Append the file to the array #
|
||||
################################
|
||||
FILE_ARRAY_RUBY+=("$FILE")
|
||||
##########################################################
|
||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||
##########################################################
|
||||
READ_ONLY_CHANGE_FLAG=1
|
||||
else
|
||||
############################
|
||||
# Extension was not found! #
|
||||
############################
|
||||
echo " - WARN! Failed to get filetype for:[$FILE]!"
|
||||
##########################################################
|
||||
# Set the READ_ONLY_CHANGE_FLAG since this could be exec #
|
||||
##########################################################
|
||||
READ_ONLY_CHANGE_FLAG=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in a new issue