Clone a Specific Branch of the shinyAppPkgs Repository and Optionally Open it
Source:R/get_app.R
get_app.Rd
Clones a specified branch of the shinyAppPkgs
GitHub repository into the
current working directory. It cleans the cloned directory by removing .git
files, .DS_Store
, and .Rbuildignore
files, renames the R project file,
and optionally opens it in a new RStudio 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 new R project in a new RStudio session usingrstudioapi::openProject
. Defaults toFALSE
.
Details
If the directory for the branch already exists, it is deleted and re-cloned to ensure the latest version is present. After cloning, the function performs cleanup operations:
Deletes
.git
directory and files.Removes
.DS_Store
files.Deletes any
.Rbuildignore
files present. It then renames the R project file to match the name of the cloned branch and, if specified, opens the project in RStudio.
Note
The
rstudioapi::openProject
function requires RStudio to be installed and will only work if R is running inside RStudio.The working directory is temporarily changed during the function's execution but is reset at the end.