module_skeleton: Generate a skeleton for a module

View source: R/build.R

module_skeletonR Documentation

Generate a skeleton for a module

Description

Create all the base files and folders to kickstart the development of a new outsider module. Returns file path to new module.

Usage

module_skeleton(
  program_name,
  repo_user = NULL,
  docker_user = NULL,
  flpth = getwd(),
  module_name = NULL,
  cmd = program_name,
  full_name = NULL,
  email = NULL,
  service = c("github", "gitlab", "bitbucket"),
  overwrite = FALSE
)

Arguments

program_name

Name of the command-line program.

repo_user

Developer's username for code sharing service. If NULL, no code sharing site information is added.

docker_user

Developer's username for Docker. If NULL, no docker information is added.

flpth

File path to location of where module will be created, default current working directory.

module_name

Name of the module, if NULL rendered as "om..[program_name]"

cmd

Command-line call for program, default [program_name]

full_name

Your full name (for authorship)

email

Your email (for authorship)

service

Code-sharing site.

overwrite

Automatically overwrite pre-existing files? If FALSE, user is queried whether to overwrite for each pre-existing file.

Details

If full_name and email are provided, then new lines are added to DESCRIPTION specifying the author and maintainer of the package.

Value

Character

See Also

Other build: module_build(), module_check(), module_identities(), module_test(), module_travis(), module_upload()

Examples

library(outsider)

# build file structure for an example module
module_path <- module_skeleton(program_name = "goldenhind",
                               repo_user = "drake_on_github",
                               docker_user = "drake_on_docker",
                               full_name = 'Sir Francis Drake',
                               email = 'f.drake@goldenhind.gov.uk',
                               service = 'github',
                               flpth = tempdir())
# new path created 
(module_path)
# check the generated names and links
module_identities(flpth = module_path)
# check the files are in the right locations
module_check(flpth = module_path)
# deliberately break: delete a folder and check again
unlink(x = file.path(module_path, 'inst'), recursive = TRUE, force = TRUE)
module_check(flpth = module_path)

# clean-up
unlink(x = module_path, recursive = TRUE, force = TRUE)

AntonelliLab/outsider.devtools documentation built on June 20, 2022, 4:36 a.m.