bootstrap()
Prepare a Cloned Project
Gets a project ready to work in after git clone, on a new machine or a cluster. Every step is safe to repeat, and none contacts Framework Cloud:
Usage
bootstrap(path = ".", interactive = base::interactive(), packages = TRUE)
Arguments
| Name | Default | Description |
|---|---|---|
| path | "." |
The project folder (default: the current directory). |
| interactive | base::interactive() |
If |
| packages | TRUE |
If |
Value
Invisibly, a list with root, done (the steps that changed something), and todo (things left to do by hand).
Details
- Make sure
.gitignoreignores.env. - Create
.envfrom.env.examplewhen it is missing, and list the variables that are still empty. - Create the project folders, which git does not carry when they are empty or ignored. Absolute paths (shared drives) are left alone.
- Create
framework.db, or add the tables a newer version needs. - Install packages:
renv::restore()when the project hasrenv.lock, otherwise the packages listed in settings.yml. - Install the git hooks enabled in settings.yml.
The Python package and fw bootstrap follow the same contract. From a shell: Rscript -e 'framework::bootstrap(interactive = FALSE)', which exits with status 0 when the project is ready (even with to-dos left) and 1 when a step failed.
Examples
Not run
if (FALSE) {
# After cloning a project
framework::bootstrap()
# In a job script on a cluster
framework::bootstrap(interactive = FALSE)
}