Merge pull request #462 from nemchik/bash-expansion

Simplify extension extraction
This commit is contained in:
Lukas Gravley 2020-07-22 13:39:15 -05:00 committed by GitHub
commit ca69d68311
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -84,9 +84,10 @@ function BuildFileList() {
########################### ###########################
# Get the files extension # # Get the files extension #
########################### ###########################
# Extract just the file and extension, reverse it, cut off extension, # Extract just the file extension
# reverse it back, substitute to lowercase FILE_TYPE=${FILE##*.}
FILE_TYPE=$(basename "${FILE}" | rev | cut -f1 -d'.' | rev | awk '{print tolower($0)}') # To lowercase
FILE_TYPE=${FILE_TYPE,,}
############## ##############
# Print file # # Print file #