diff --git a/R/build-favicons.R b/R/build-favicons.R index 76ae0623f..02ff058b2 100644 --- a/R/build-favicons.R +++ b/R/build-favicons.R @@ -42,7 +42,7 @@ build_favicons <- function(pkg = ".", overwrite = FALSE) { i = "Building favicons with {.url https://realfavicongenerator.net} ..." )) - logo <- readBin(logo_path, what = "raw", n = fs::file_info(logo_path)$size) + logo <- readBin(logo_path, what = "raw", n = file_info(logo_path)$size) json_request <- list( "favicon_generation" = list( diff --git a/R/build-home-index.R b/R/build-home-index.R index 39a723157..dbd44827a 100644 --- a/R/build-home-index.R +++ b/R/build-home-index.R @@ -65,7 +65,7 @@ data_home_sidebar <- function(pkg = ".", call = caller_env()) { if (length(html_path)) { if (!file.exists(html_path)) { - rel_html_path <- fs::path_rel(html_path, pkg$src_path) + rel_html_path <- path_rel(html_path, pkg$src_path) config_abort( pkg, "{.field home.sidebar.html} specifies a file that doesn't exist ({.file {rel_html_path}}).", diff --git a/R/build-home-md.R b/R/build-home-md.R index 54024a5f6..9f3a76988 100644 --- a/R/build-home-md.R +++ b/R/build-home-md.R @@ -20,7 +20,7 @@ package_mds <- function(path, in_dev = FALSE) { # Do not build 404 page if in-dev if (in_dev) { - mds <- mds[fs::path_file(mds) != "404.md"] + mds <- mds[path_file(mds) != "404.md"] } # Remove files that don't need to be rendered @@ -29,7 +29,7 @@ package_mds <- function(path, in_dev = FALSE) { "pull_request_template.md", "cran-comments.md" ) - mds <- mds[!fs::path_file(mds) %in% no_render] + mds <- mds[!path_file(mds) %in% no_render] unname(mds) } @@ -45,7 +45,7 @@ render_md <- function(pkg, filename) { pagetitle = attr(body, "title"), body = body, filename = filename, - source = repo_source(pkg, fs::path_rel(filename, pkg$src_path)) + source = repo_source(pkg, path_rel(filename, pkg$src_path)) ), path = path ) diff --git a/R/build-logo.R b/R/build-logo.R index 80b8d4d73..b5f2010a5 100644 --- a/R/build-logo.R +++ b/R/build-logo.R @@ -34,5 +34,5 @@ logo_path <- function(pkg, depth) { return() } - paste0(up_path(depth), fs::path_file(path)) + paste0(up_path(depth), path_file(path)) } diff --git a/R/build-search-docs.R b/R/build-search-docs.R index 3c66e1062..6711edcef 100644 --- a/R/build-search-docs.R +++ b/R/build-search-docs.R @@ -171,11 +171,11 @@ file_search_index <- function(path, pkg) { } # Directory parts (where in the site) get_dir <- function(path) { - dir <- fs::path_dir(path) + dir <- path_dir(path) if (dir == ".") { return("") } - paste(capitalise(unlist(fs::path_split(dir))), collapse = " > ") + paste(capitalise(unlist(path_split(dir))), collapse = " > ") } # Headings (where in the page) get_headings <- function(section, depth) { @@ -303,10 +303,10 @@ capitalise <- function(string) { } get_site_paths <- function(pkg) { - paths <- fs::dir_ls(pkg$dst_path, glob = "*.html", recurse = TRUE) - paths_rel <- fs::path_rel(paths, pkg$dst_path) + paths <- dir_ls(pkg$dst_path, glob = "*.html", recurse = TRUE) + paths_rel <- path_rel(paths, pkg$dst_path) # do not include dev package website in search index / sitemap dev_destination <- meta_development(pkg$meta, pkg$version)$destination - paths_rel[!fs::path_has_parent(paths_rel, "dev")] + paths_rel[!path_has_parent(paths_rel, "dev")] } diff --git a/R/check-built.R b/R/check-built.R index 582bb647d..4b3b84fa6 100644 --- a/R/check-built.R +++ b/R/check-built.R @@ -15,8 +15,8 @@ check_missing_images <- function(pkg, src_path, dst_path) { src <- xml2::xml_attr(img, "src") rel_src <- src[xml2::url_parse(src)$scheme == ""] - rel_path <- fs::path_norm(path(fs::path_dir(dst_path), rel_src)) - exists <- fs::file_exists(path(pkg$dst_path, rel_path)) + rel_path <- path_norm(path(path_dir(dst_path), rel_src)) + exists <- file_exists(path(pkg$dst_path, rel_path)) if (any(!exists)) { paths <- rel_src[!exists] diff --git a/R/config.R b/R/config.R index ae2e37e2a..7c4a78e72 100644 --- a/R/config.R +++ b/R/config.R @@ -132,5 +132,5 @@ config_path <- function(pkg) { if (is.null(config)) { cli::cli_abort("Can't find {.file _pkgdown.yml}.", .internal = TRUE) } - cli::style_hyperlink(fs::path_file(config), paste0("file://", config)) + cli::style_hyperlink(path_file(config), paste0("file://", config)) } diff --git a/R/context.R b/R/context.R index 1372659a8..a82ecc0b6 100644 --- a/R/context.R +++ b/R/context.R @@ -68,7 +68,7 @@ context_set_scoped <- function(name, value, scope = parent.frame()) { article_index <- function(pkg) { set_names( - fs::path_rel(pkg$vignettes$file_out, "articles"), + path_rel(pkg$vignettes$file_out, "articles"), pkg$vignettes$name ) } diff --git a/R/deploy-site.R b/R/deploy-site.R index b27def52d..28aa8627c 100644 --- a/R/deploy-site.R +++ b/R/deploy-site.R @@ -65,7 +65,7 @@ deploy_site_github <- function( cli::cli_inform("Copying private key to {.file ssh_id_file}") write_lines(rawToChar(openssl::base64_decode(ssh_id)), ssh_id_file) cli::cli_inform("Setting private key permissions to 0600") - fs::file_chmod(ssh_id_file, "0600") + file_chmod(ssh_id_file, "0600") cli::cli_inform("Setting remote to use the ssh url") @@ -110,8 +110,8 @@ deploy_to_branch <- function(pkg = ".", github_pages = (branch == "gh-pages"), ..., subdir = NULL) { - dest_dir <- fs::dir_create(fs::file_temp()) - on.exit(fs::dir_delete(dest_dir)) + dest_dir <- dir_create(file_temp()) + on.exit(dir_delete(dest_dir)) if (!git_has_remote_branch(remote, branch)) { old_branch <- git_current_branch() @@ -137,7 +137,7 @@ deploy_to_branch <- function(pkg = ".", site_dest_dir <- if (!is.null(subdir)) { - fs::dir_create(fs::path(dest_dir, subdir)) + dir_create(path(dest_dir, subdir)) } else { dest_dir } diff --git a/R/init.R b/R/init.R index 7032a9cac..4597fc310 100644 --- a/R/init.R +++ b/R/init.R @@ -95,7 +95,7 @@ copy_asset_dir <- function(pkg, } src_paths <- dir_ls(src_dir, recurse = TRUE) - src_paths <- src_paths[!fs::is_dir(src_paths)] + src_paths <- src_paths[!is_dir(src_paths)] if (!is.null(file_regexp)) { src_paths <- src_paths[grepl(file_regexp, path_file(src_paths))] } diff --git a/R/pkgdown.R b/R/pkgdown.R index bafbd0624..5df8abb1b 100644 --- a/R/pkgdown.R +++ b/R/pkgdown.R @@ -65,8 +65,8 @@ local_pkgdown_template_pkg <- function(path = NULL, meta = NULL, env = parent.fr } if (!is.null(meta)) { - path_pkgdown_yml <- fs::path(path, "inst", "pkgdown", "_pkgdown.yml") - fs::dir_create(fs::path_dir(path_pkgdown_yml)) + path_pkgdown_yml <- path(path, "inst", "pkgdown", "_pkgdown.yml") + dir_create(path_dir(path_pkgdown_yml)) yaml::write_yaml(meta, path_pkgdown_yml) } diff --git a/R/render.R b/R/render.R index 0bf4f6724..153eeac7f 100644 --- a/R/render.R +++ b/R/render.R @@ -220,7 +220,7 @@ write_if_different <- function(pkg, contents, path, quiet = FALSE, check = TRUE) if (same_contents(full_path, contents)) { # touching the file to update its modification time # which is important for proper lazy behavior - fs::file_touch(full_path) + file_touch(full_path) return(FALSE) } diff --git a/R/utils-fs.R b/R/utils-fs.R index 6ce30bc27..bf98cf4bf 100644 --- a/R/utils-fs.R +++ b/R/utils-fs.R @@ -12,7 +12,7 @@ dir_copy_to <- function(src_dir, } src_paths <- dir_ls(src_dir, recurse = TRUE) - is_dir <- fs::is_dir(src_paths) + is_dir <- is_dir(src_paths) dst_paths <- path(dst_dir, path_rel(src_paths, src_dir)) @@ -36,7 +36,7 @@ file_copy_to <- function(src_paths, src_label = "", dst_label = "") { # Ensure all the "to" directories exist - dst_dirs <- unique(fs::path_dir(dst_paths)) + dst_dirs <- unique(path_dir(dst_paths)) dir_create(dst_dirs) eq <- purrr::map2_lgl(src_paths, dst_paths, file_equal) @@ -54,7 +54,7 @@ file_copy_to <- function(src_paths, # Checks init_site() first. create_subdir <- function(pkg, subdir) { - if (!fs::dir_exists(pkg$dst_path)) { + if (!dir_exists(pkg$dst_path)) { init_site(pkg) } dir_create(path(pkg$dst_path, subdir)) @@ -134,5 +134,5 @@ pkgdown_config_relpath <- function(pkg) { pkg <- as_pkgdown(pkg) config_path <- pkgdown_config_path(pkg$src_path) - fs::path_rel(config_path, pkg$src_path) + path_rel(config_path, pkg$src_path) }