Skip to content

Commit

Permalink
Make getFileType tolerant to uppercase extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisfacer committed Oct 19, 2022
1 parent 0a8ed3d commit 65158da
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions R/DataMart.R
Expand Up @@ -425,20 +425,20 @@ getClientId <- function()
#' @noRd
getFileType <- function(filename)
{
if (file_ext(filename) == "rds")
return ("rds")
if (tolower(file_ext(filename)) == "rds")
return("rds")

if (file_ext(filename) == "sav")
return ("sav")
if (tolower(file_ext(filename)) == "sav")
return("sav")

# probably redundant
if (file_ext(filename) == "csv" || guess_type(filename) == "text/csv")
return ("csv")
if (tolower(file_ext(filename)) == "csv" || guess_type(filename) == "text/csv")
return("csv")

if (file_ext(filename) == "rda")
return ("rda")
if (tolower(file_ext(filename)) == "rda")
return("rda")

if (file_ext(filename) == "pptx")
if (tolower(file_ext(filename)) == "pptx")
return("pptx")

return (NULL)
Expand Down

0 comments on commit 65158da

Please sign in to comment.