Clones a branch of the sap GitHub
repository into the current working directory, then cleans it up: .git
files, .DS_Store files, and .Rbuildignore files are removed, and the
.Rproj file is renamed to match the branch. Set open = TRUE to open the
result in a new IDE session.
Arguments
- app
The name of the branch to be cloned as a character string. If not specified, defaults to "main".
- open
A logical parameter, when set to
TRUE, the function will attempt to open the project directory in a new session usingrstudioapi::openProject. Defaults toFALSE.
Details
The branch is cloned into a temporary folder first. If the clone succeeds and
the directory for the branch already exists, the old copy is replaced so you
always get the latest commit. If the clone fails, the existing copy is left
untouched. After cloning, get_app() removes:
The
.gitdirectory and filesAny
.DS_StorefilesAny
.Rbuildignorefiles
It then renames the .Rproj file to match the cloned branch and, if
open = TRUE, opens the project.
Note
The
rstudioapi::openProjectfunction works in RStudio and Positron. The project directory is passed directly, so no.Rprojfile is required.