Skip to content

Commit

Permalink
👌 added comment explaining slash removal code
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Patrick Kyle committed Mar 8, 2019
1 parent b6af99b commit b77c94d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,10 @@ get_package_mapping <- function(script_name, url_package, dependencies) {
dep_path <- file.path(x$src$file,
x$script)

# remove n>1 slashes and replace with / if present
# remove n>1 slashes and replace with / if present;
# htmltools seems to permit // in pathnames, but
# this complicates string matching unless they're
# removed from the pathname
result <- c(pkg_name=ifelse("package" %in% names(x), x$package, NULL),
dep_name=x$name,
dep_path=gsub("//+", replacement = "/", dep_path)
Expand Down

0 comments on commit b77c94d

Please sign in to comment.