onedrive_sanitize: Sanitize a project folder for compatibility with OneDrive

Description Usage Arguments Value

View source: R/project-maintenance.R

Description

Run this function after creating a new RStudio project if it is stored within a OneDrive folder. This function performs the following steps: (1) copy the selected folders (.Rproj.user and/or .git) onto the local file system outside of OneDrive, (2) write a function to an Rscript file within the project directory, (3) write the Windows cmd text to run that script to the clipboard. At that point, the user will need to close RStudio and paste the text into a Windows cmd prompt. This will run the newly-created script, which will (4) delete the selected files from within the RStudio project directory and replace them with symbolic links to the copies outside of OneDrive.

Usage

1
2
3
onedrive_sanitize(what = c("rproj", "git", "rhistory"),
  dest_root = fs::path("C:", "Users", Sys.info()[["user"]],
  "rstudio-projects"))

Arguments

what

A character vector. Either "rproj", "git", or c("rproj", "git") (the default).

dest_root

The file path to which to move the specified files (should be outside OneDrive).

Value

Run for its side effects.


danielbride/dfunc documentation built on Jan. 1, 2020, 12:54 a.m.