mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-22 00:31:07 -05:00
Merge pull request #462 from nemchik/bash-expansion
Simplify extension extraction
This commit is contained in:
commit
ca69d68311
1 changed files with 4 additions and 3 deletions
|
@ -84,9 +84,10 @@ function BuildFileList() {
|
|||
###########################
|
||||
# Get the files extension #
|
||||
###########################
|
||||
# Extract just the file and extension, reverse it, cut off extension,
|
||||
# reverse it back, substitute to lowercase
|
||||
FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}')
|
||||
# Extract just the file extension
|
||||
FILE_TYPE=${FILE##*.}
|
||||
# To lowercase
|
||||
FILE_TYPE=${FILE_TYPE,,}
|
||||
|
||||
##############
|
||||
# Print file #
|
||||
|
|
Loading…
Reference in a new issue