Automatically detect the type of path (file, package, or directory) and apply the appropriate flir fix function.
Details
The function determines the fix strategy based on the path type:
If
pathpoints to an existing file, callsflir::fix()If
pathis a package directory (contains DESCRIPTION), callsflir::fix_package()If
pathis a directory, callsflir::fix_dir()
Examples
tmp <- tempfile(fileext = ".R")
writeLines("a<-1+1", tmp)
flir_fix(tmp)
#> ℹ Fixing R code in /tmp/RtmpAM3FIu/file1b245a55b7c5.R
#> ℹ Going to check 1 file.
#> ✔ No fixes needed.
cat(readLines(tmp, warn = FALSE), sep = "\n")
#> a<-1+1
