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
If the directory for the branch already exists, it's deleted and re-cloned so
you always get the latest commit. 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.The working directory is temporarily changed during the function's execution but is reset at the end.