gp_change_file: Change a source file in place

View source: R/utils.R

gp_change_fileR Documentation

Change a source file in place

Description

Utility function to make changes to a source file

Usage

gp_change_file(
  path = system.file("js/src/App.js", package = "geoplumber"),
  what = " * geoplumber R package code.",
  pattern = " * geoplumber R package code.",
  before = TRUE,
  replace = FALSE,
  verbose = FALSE
)

Arguments

path

path of file to change, used in readLines()

what

vector to add to path

pattern

where to add the what to, 1st is used. Unique is best.

before

s after the pattern

replace

or replace pattern

verbose

cat the change out

Examples

{
 gp_change_file(replace = TRUE, verbose = TRUE) # replacing the comment itself.
}

ATFutures/geoplumber documentation built on July 4, 2023, 12:18 a.m.