Skip to contents

Export a ROCK project to a single ROCKproject file

Usage

export_ROCKproject(
  output,
  path = ".",
  config = NULL,
  includeRegex = NULL,
  excludeRegex = NULL,
  createDirs = FALSE,
  preventOverwriting = TRUE,
  forceBaseZip = FALSE,
  silent = rock::opts$get("silent")
)

Arguments

output

The file to write to; should have the extension .ROCKproject

path

The path with the ROCK project

config

Optionally, a named list with configuration options to override. For supported options, see vignette("ROCKproject-format", package = "rock");

includeRegex

A regular expression used to select files to include in the project file

excludeRegex

A regular expression used to omit files from the project file; selection takes place after the selection by includeRegex

createDirs

Whether to, if any directories in the output path does not exist, create these

preventOverwriting

If the output file already exists, whether to prevent it from being overwritten (TRUE) or not (FALSE).

forceBaseZip

Whether to force using the zip() function included in R even if the zip package is installed.

silent

Whether to be chatty or silent

Value

Invisibly, output.

Examples

### Get path to example project
examplePath <-
  system.file(
    "ROCKprojects",
    "exportable-ROCKproject-1",
    package="rock"
  );

### Get a temporary filename to write to
projectFilename <-
  tempfile(
    fileext = ".ROCKproject"
  );

### Export it
rock::export_ROCKproject(
  path = examplePath,
  output = projectFilename,
  silent = FALSE
);
#> The full list of files is
#> 
#>   - _ROCKproject.yml
#>   - data/010---raw-sources/pId-away---1st.rock
#>   - data/010---raw-sources/pId-away---2nd.rock
#>   - data/010---raw-sources/pId-bank---1st.rock
#>   - data/010---raw-sources/pId-bank---2nd.rock
#>   - data/010---raw-sources/pId-base---1st.rock
#>   - data/010---raw-sources/pId-base---2nd.rock
#>   - data/010---raw-sources/pId-card---1st.rock
#>   - data/010---raw-sources/pId-card---2nd.rock
#>   - data/010---raw-sources/pId-cash---1st.rock
#>   - data/010---raw-sources/pId-cash---2nd.rock
#>   - data/010---raw-sources/pId-chat---1st.rock
#>   - data/010---raw-sources/pId-chat---2nd.rock
#>   - data/010---raw-sources/pId-crow---1st.rock
#>   - data/010---raw-sources/pId-crow---2nd.rock
#>   - data/010---raw-sources/pId-fine---1st.rock
#>   - data/010---raw-sources/pId-fine---2nd.rock
#>   - data/010---raw-sources/pId-fire---1st.rock
#>   - data/010---raw-sources/pId-fire---2nd.rock
#>   - data/010---raw-sources/pId-fish---1st.rock
#>   - data/010---raw-sources/pId-fish---2nd.rock
#>   - data/010---raw-sources/pId-here---1st.rock
#>   - data/010---raw-sources/pId-here---2nd.rock
#>   - data/010---raw-sources/pId-iron---1st.rock
#>   - data/010---raw-sources/pId-iron---2nd.rock
#>   - data/010---raw-sources/pId-kick---1st.rock
#>   - data/010---raw-sources/pId-kick---2nd.rock
#>   - data/010---raw-sources/pId-life---1st.rock
#>   - data/010---raw-sources/pId-life---2nd.rock
#>   - data/010---raw-sources/pId-main---1st.rock
#>   - data/010---raw-sources/pId-main---2nd.rock
#>   - data/010---raw-sources/pId-near---1st.rock
#>   - data/010---raw-sources/pId-near---2nd.rock
#>   - data/010---raw-sources/pId-push---1st.rock
#>   - data/010---raw-sources/pId-push---2nd.rock
#>